DominicMaas / TimelineExtension

Windows Timeline & Project Rome Web Extension
MIT License
483 stars 27 forks source link

Move all authentication to use the "fallback" method. #77

Open DominicMaas opened 6 years ago

DominicMaas commented 6 years ago

There seems to be some issues when using chrome.identity.launchWebAuthFlow() with the popup box just not appearing. The fallback method creates a new tab, redirects to a blank page where we then collect the token. Works much faster and helps condense code.

It should be noted that users who are already logged in need to keep using the old client id otherwise refresh tokens will not work. New users can use the "fallback" client id. Perform some kind of check (like storing a variable on login in storage) that separates old and new users.

DominicMaas commented 6 years ago

In the latest commit I added changes to use the new auth system for new users. I did perform some brief testing for existing users, but if someone watching could give it a test and see if everything still works, that would be great!

The aim is to not break existing logged in accounts (including refresh tokens), while implementing an easier system for new users.

DominicMaas commented 6 years ago

Firefox has issues signing in with the new code, see #61

Error: Opener tab must be in the same window as the tab being created => undefined
tab is undefined => background.js:217
Unchecked lastError value: Error: Invalid tab ID: 254 => background.js:216

Seems having multiple windows open while signing in does not work.