You must be logged in to verify the email address.
This also means that the browser that opens when you click the link, must be the same one that has your logged in session.
Hello,
Is there any problem with Fortify v1.27 ?
When I create a new user via the registration form, I receive an email with a link to verify the email.
When I click on the link, I am redirected to the login page and email_verified_at is not updated with the date.
I regularly use Fortify and it's the first time I get this behavior.
Thanks for your help.
V
You must be logged in to verify the email address.
This also means that the browser that opens when you click the link, must be the same one that has your logged in session.
Yes it's the case.
Hmmm ... When I register, I'm using the fortify routes, I type the name, email, ... I click on the register button and I am redirected to the email/verify URL.
Then I check my emails, I click on the verification button (email/verify/{id}/{hash}) and I am redirected to the login page.
I really don't understand why.
I just checked something.
When I click on the link, it doesn't work.
But if I copy / paste the link in the browser, then it work.
Why ? What happens ?
because when you click the link in the email you are using a different browser?
Or your registration session is in private browsing mode?
None of both.
I'm using the database session driver.
Could it be the problem ? But it were the problem, it would also not work when I copy / paste the link.
unlikely to be the issue. Assuming the link is identical, whether you click on it or paste it, then its down to whether the app recognises you are the same session, which is done via cookies in the client.
I get this in the Laravel debugbar in the session when I copy / paste.
array:1 [
"intended" => "http://localhost:8000/email/verify/01kjm7h6q1p180x5t0mvdehdh2/89c321e779a4d18b15501669f7a1027e9c386706?expires=1772356789&signature=55cc2866b5ca2e194f1b0f8f67f62a53a5c26bfd0c7443864391049cf35b977d"
]
But when I click on the link, I only the the token and nothing else.
Perhaps a useful information, but I don't know what I can do with it.
When I open the registration page, one session is stored in the database.
When I click on the link received by email to verify my email, 2 additional sessions are created in the database.
what is the link exactly?
It's the link generated by Fortify to confirm the email address.
Before I click on the link, I can refresh the page http://localhost:8000/email/verify several times, the same page is reloaded.
After I have clicked on the link, if I refresh the page, I am redirected to the login page. So when I click on the link, Laravel logs out the user.
Here it is ... I just solved it.
It was in my session configuration.
I had : SESSION_SAME_SITE=strict and I changed it to : SESSION_SAME_SITE=lax.
Is your app_url matching the install?
I have set the APP_URL in the .env file to http://localhost:8000.
Sure it won't be the same in production ;).
Please or to participate in this conversation.