Oauth2 question again

Yes it does ;_;
Btw: it change in globalthis value i guess

Last time I looked at this, self didn’t change value. The fork I have here seems fine https://playcanvas.com/project/765199/overview/google-oauth

Yes it worked for me too but there was some fault so i removed the script from the button and put it into the 2dscreen moved the this.handleClientLoad fired by the button on line 10 to line 24 and after that everything got messy :frowning:

had a simular issue a while a go, a quick and dirty work around was to rename the variable to something like self2 and everything does well again …?

@ayrin, when i saw your project, your function did not bind with this so I simply bind the “initClient” function and self issue was resolved.
image
and for the SCOPE issue, I added this.SCOPE instead of SCOPE and it worked.

You can check the fork project link too: https://playcanvas.com/editor/scene/1091108

1 Like

@Gurki tried self2 don’t work
@saif yes that worked when my project was like the one you forked, i moved the script from the button element to the screen 2d element and fired directly the handleClientLoad instead using button, and now i have this mess
Anyway i noticed that the variable change then the code enter in .then(function

1 Like

After some adjustment the login screen open and after i got this error
error login
crying…any clue?

@ayrin, just to be sure, do you have the google oath SDK available in your project and on top of the scripts loading order list?

Uhmmmmm i have 2 external scripts ajax.googleapis… and apis.google… but not google oauth sdk
EDIT: beside that error if i reload the page it sign me in so i guess i miss just a little step

1 Like

It can be that it’s due to the second message i got in console?
error signin2

No, the yellow message is a warning about not finding a sourcemap file

Anyway the code works, error message aside.
EDIT: well in the compiled version the message is not shown so i can ignore it?!?

Which message?

I meant the error message that has disapared as you can see…don’t ask me why :smiley:

1 Like

to be sure that this will not happen again you can write the error messages only to the console log and not to display screen. This won’t make it any better but your player wont see it so easyly …

My big brother always does this for us, how do I close it?