When opening a verification link in a different window context (incognito, or a different device), the following seems to happen:
Firebase initialises with the API key as expected (but the user is not logged in)
The /auth/action loads, and also verifies the email
The user reload fails because the user is not logged in
So the email is actually verified, but it seems like it is not.
Expected behaviour
Detect that the user is logged out.
Notify that the verification was successful, and that the user should now sign in.
Redirect to the sign-in page
It's possible to test this behavior locally in demo-test by taking local auth email verification URLs of the form
http://127.0.0.1:9099/emulator/action?mode=verifyEmail&lang=en&oobCode=acvMMiEBzu1Zj8U6uOI0xdjcF_sSXdu9BHAVf0xp0dyI0C1HpnQizy&apiKey=fake-api-key&continueUrl=http%3A%2F%2Flocalhost%3A5173%2Faccount and pasting the ?... bit after http://localhost:5173/auth/action manually.
When you don't do this manual edit, the following local auth email verification handling applies that is not really relevant, because it is different from the production behavior:
When opening a verification link in a different window context (incognito, or a different device), the following seems to happen:
So the email is actually verified, but it seems like it is not.
Expected behaviour
It's possible to test this behavior locally in demo-test by taking local auth email verification URLs of the form
http://127.0.0.1:9099/emulator/action?mode=verifyEmail&lang=en&oobCode=acvMMiEBzu1Zj8U6uOI0xdjcF_sSXdu9BHAVf0xp0dyI0C1HpnQizy&apiKey=fake-api-key&continueUrl=http%3A%2F%2Flocalhost%3A5173%2Faccount
and pasting the?...
bit afterhttp://localhost:5173/auth/action
manually.When you don't do this manual edit, the following local auth email verification handling applies that is not really relevant, because it is different from the production behavior:
Notes
I might have recently broken this with the new changes of moving the "Verified" notification logic outside of auth/action, see https://github.com/WelcometoMyGarden/welcometomygarden/issues/98#issuecomment-1387128152