laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.55k stars 11.03k forks source link

Verification Email not getting the hash from the request #29904

Closed socieboy closed 5 years ago

socieboy commented 5 years ago

Description:

I found a problem but for some reason implementing Email Validation in a fresh installation of Spark 9.0. When I click the link to validate the Email after registering a new User I got a 403 Unauthorized message.

Steps To Reproduce:

I step to the method verify on VerifiesEmails trait

Illuminate\Foundation\Auth\VerifiesEmails

to debug what was happening, on the second validation

if (! hash_equals((string) $request->route('hash'), sha1($request->user()->getEmailForVerification()))) {
            throw new AuthorizationException;
        }

the $request->route('hash') is returning null even when the hash key exists on the url I changed to request('hash') and it works.

So i don't know what is the difference or why I'm getting this problem, if is something that i'm doing wrong i'll appreciate the help.

jsterj commented 4 years ago

Did you ever find a fix for this? Other than rewriting that line to request('hash') ?

That works for me as well, but it doesn't seem like the proper solution.