Force new users to verify email

This commit is contained in:
Miguel Nogueira 2020-09-03 20:06:29 +01:00
parent 9f3780d844
commit 87f8e63b24
2 changed files with 3 additions and 4 deletions

View File

@ -7,11 +7,10 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles; use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable class User extends Authenticatable implements MustVerifyEmail
{ {
use Notifiable; use Notifiable;
use HasRoles; use HasRoles;
//use MustVerifyEmail;
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.

View File

@ -17,7 +17,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l
Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function (){ Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function (){
Auth::routes(); Auth::routes(['verify' => true]);
Route::post('/twofa/authenticate', 'Auth\TwofaController@verify2FA') Route::post('/twofa/authenticate', 'Auth\TwofaController@verify2FA')
->name('verify2FA'); ->name('verify2FA');
@ -31,7 +31,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'l
->name('sendSubmission'); ->name('sendSubmission');
Route::group(['middleware' => ['auth', 'forcelogout', '2fa']], function(){ Route::group(['middleware' => ['auth', 'forcelogout', '2fa', 'verified']], function(){
Route::get('/dashboard', 'DashboardController@index') Route::get('/dashboard', 'DashboardController@index')
->name('dashboard') ->name('dashboard')