From 87f8e63b24ff72a0673cd60a2d276b66694cd59d Mon Sep 17 00:00:00 2001 From: Miguel N Date: Thu, 3 Sep 2020 20:06:29 +0100 Subject: [PATCH] Force new users to verify email --- app/User.php | 3 +-- routes/web.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/User.php b/app/User.php index 1e76521..06f555f 100644 --- a/app/User.php +++ b/app/User.php @@ -7,11 +7,10 @@ use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Spatie\Permission\Traits\HasRoles; -class User extends Authenticatable +class User extends Authenticatable implements MustVerifyEmail { use Notifiable; use HasRoles; - //use MustVerifyEmail; /** * The attributes that are mass assignable. diff --git a/routes/web.php b/routes/web.php index ac80992..87a50da 100644 --- a/routes/web.php +++ b/routes/web.php @@ -17,7 +17,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function (){ - Auth::routes(); + Auth::routes(['verify' => true]); Route::post('/twofa/authenticate', 'Auth\TwofaController@verify2FA') ->name('verify2FA'); @@ -31,7 +31,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l ->name('sendSubmission'); - Route::group(['middleware' => ['auth', 'forcelogout', '2fa']], function(){ + Route::group(['middleware' => ['auth', 'forcelogout', '2fa', 'verified']], function(){ Route::get('/dashboard', 'DashboardController@index') ->name('dashboard')