Closed arebuffo closed 4 years ago
@arebuffo What do you mean by the user is not refreshed until the next login
?
Hi,
Sorry about the bad phrasing.
When the user verifies the token successfully, the hasVerifiedMobile() still returns false, unless I logoff and logon again. The routes are still redirected to the verification page.
Alex
I think it might be my mistake. I replaced, for the sake of simplicity, the middleware route 'verified':
'verified' => \App\Http\Middleware\EnsureMobileIsVerified::class,
// 'verified' => \App\Http\Middleware\EnsureEmailIsVerified::class,
and maybe I should include mobile.verified.
@arebuffo Yes. You should not use it as a middleware globally. Please read this part of the document : https://github.com/mohammad-fouladgar/laravel-mobile-verification#protecting-routes
You do not need to register EnsureMobileIsVerified
middleware, because this has already registered. Also, This is not relate to EnsureEmailIsVerified
middleware.
I'll close this issue, but you can reopen if you need it.
Hi,
I managed to make it work, it works flawlessly, with my own VueJS SPA, sanctum as the auth, etc.
The only trouble I have is that once I verified the token, the user is not refreshed until the next login. Is this normal? I can't find a way to do it without forcing something.
Thank you