1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 16:24:29 +00:00
pixelfed/app/Http/Middleware/EmailVerificationCheck.php

37 lines
647 B
PHP
Raw Normal View History

2018-06-14 05:30:43 +00:00
<?php
namespace App\Http\Middleware;
2018-08-28 03:07:36 +00:00
use Closure;
2018-06-14 05:30:43 +00:00
class EmailVerificationCheck
{
2021-05-12 01:59:24 +00:00
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($request->user() &&
config_cache('pixelfed.enforce_email_verification') &&
is_null($request->user()->email_verified_at) &&
!$request->is(
'i/auth/*',
'i/verify-email',
'log*',
'i/confirm-email/*',
'settings/home',
'settings/email'
)
) {
return redirect('/i/verify-email');
}
2018-08-28 03:07:36 +00:00
2021-05-12 01:59:24 +00:00
return $next($request);
}
2018-06-14 05:30:43 +00:00
}