javascript - How to signin on a web app properly if already signedin with Google somewhere on the web? -
i'm making web application using javascript. i'm able signin, signout google account , read/write file google drive, have found weird exception.
here how can reproduce exception:
- i open chrome empty chace
- i signin on google drive
- i run debug of web app visual studio (the web app not published yet, can't test it)
now web app seems signin same google account , start file google drive (the 1 want), process interrupted in way. have made checks in code sure web app able file or return error, "error code 0", while of times don't error , no file retrieved.
i'm sure wrong using google api, don't know what. when run web app (in case above) signin button of google calls automatically following function:
function checkauth() { gapi.auth.authorize( { 'client_id': client_id, 'scope': scopes, 'immediate': true }, handleauthresult); } so web app seems signedin, doesn't work.
actually have found solution, in opinion bad one: if web app doesn't have important data >> , i'm signed in google somewhere on web >> call "signout()" function.
so if signin again in web app works should.
can give me better solution, avoiding "signout" followed "signin" i'm using?
Comments
Post a Comment