Make login button issue a URL re-load each click
If a login oauth page fails to load, then clicking on the login button just takes you back to the tab that has a page that failed to load. Instead, I suggest that the connect to a network should issue a URL reload on each login click. That way if the first auth page load fails, the user doesn't get stuck.
Another variation of this is if you click Login, then in the login tab change the URL to visit some other page - in that case clicking Login again should return you to the intended login page (e.g. google account chooser)
No, in that case it should open a new tab with google login url.
In progress here: https://github.com/uProxy/uproxy/pull/566
We've bounced between solutions but the most recent stream of thought suggests:
- launch a new tab each time Connect is clicked
- don't keep track of the newest auth tab's ID; this means
- we cannot activate an open auth tab (but that's ok because we're always launching a new tab)
- we will allow any open auth tab to login (i.e. don't check if the tab being redirected to our login page has a specific ID)
- onTabClose needs to be edited so that closing one of several auth tabs does not remove the onTabChange listener (which should continue to listen for changes in remaining auth tabs)
One way to address 3) is to remove the onTabClose listener entirely, add the onTabChange listener when ChromeTabAuth is created, and just always keep that listener alive. Or we can add the onTabChange functionality to the chrome.webRequest.onBeforeRequest listener inside background.ts, since it already checks for all redirects.
One problem with this solution is that we will no longer be able to give a "Login abandoned" error that is currently fired when an auth tab is closed. A potential workaround is to keep track of all auth tabs and display that error if all auth tabs are closed (seems suboptimal).
Unclear that a "login abandonded" notification when a user closes a tab is a useful thing; after all they have just closed the tab. :)
Further progress on this is waiting for freedom 0.6, in case that affects OAuth.