rsabbarton / PixelFlux

Pixel Art Sprite Creator
0 stars 0 forks source link

Graceful Signout not working #35

Closed rsabbarton closed 6 months ago

rsabbarton commented 1 year ago

When attempting to perform functions that require server access an exception occurs if you have been logged in for longer than the auth token expiry.

Uncaught (in promise) SyntaxError: Unexpected token 'T', "Token Not Set" is not valid JSON at JSON.parse () at pixeleditor.js:1218:29 (anonymous) @ pixeleditor.js:1218 Promise.then (async) appendServerSpritesToOpenGallery @ pixeleditor.js:1211 showLoadGallery @ pixeleditor.js:1205 (anonymous) @ menuhandler.js:53 (anonymous) @ pixeleditor.js:48 menuClicked @ flux.js:496 menu.onclick @ flux.js:450 pixeleditor.js:1212

Need to catch invalid auth tokens and switch back to the signin with google button instead of the user profile display.

rsabbarton commented 1 year ago

Now it gracefully fails but doesn't show the button to sign in until you refresh the page. Need a check on server response to updated the button display.

rsabbarton commented 1 year ago

Increased longevity of private access tokens by validating them locally instead of re-sending to google every time. This reduces un-necessary signout.

rsabbarton commented 6 months ago

Closing as google OAuth and server-side features have been removed since migration to GH Pages.