shorebird
shorebird copied to clipboard
fix: Shorebird login exception - state did not match
App ID: N/A
When running "shorebird login" to initialize, opening the link and clicking on the right email, I got a local host screen with the error Exception: Invalid response from server (state did not match).
A clear and concise description of what the bug is.
Steps To Reproduce
- Install shorebird like normal
- run 'shorebird login'
- Open the link given & click on the right email
- See error, should see as below
Hi @ThomasVuNguyen 👋 Thanks for opening an issue!
Does this issue persist when you close all browser tabs and try again? Have you tested in an incognito window? If you're still having trouble can you let us know what operating system and browser you're using? Thanks!
I have not tried in cognito but I found this:
When I run shorebird login on the android studio terminal in the flutter project folder -> fail
But when I run login on a PowerShell, it worked!
I wonder if there is some restriction in certain terminals about opening ports? My (not precise) understanding is how the oauth flow works is:
- The CLI makes a request to Google, gets a URL.
- The CLI opens that URL in a web browser.
- The user does the OAuth flow from that URL.
- On completion of the flow, it posts to https://localhost:1234/ (or whatever the port number) which was negotiated with Google in step 1.
- The CLI takes the result from the post and probably talks to google again. 🤷
Where we typically see oauth flows fail are either if the User's network can't talk to oauth.google.com (e.g. the page load fails in the web browser). Or sometimes there seems to be some sort of firewall which prevents oauth.google.com from posting back to localhost. This can also happen from edits to /etc/host (which in today's world you basically never want to do).
Since this one is resolved, I think we'll close this for now and wait for a new report. Thank you for reporting!