laravel / framework

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

The Verify Middleware does not work #38244

Closed thecyrilcril closed 3 years ago

thecyrilcril commented 3 years ago

Description:

I have setup a Laravel Project and installed Fortify and Sanctum as the frontend is a Vue SPA. I also have email Verification set up everything works to this point. but when I tried to access the following protected route without verifying the email,

Route::middleware(['auth:sanctum', 'verified'])->get('/user', function (Request $request) {
    return $request->user();
});

it works without the expected (403, 'Your email address is not verified.') error.

My User models implements MustVerifyEmail and I am not getting any errors

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable implements MustVerifyEmail
{
 ....
driesvints commented 3 years ago

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.