Add option to enable email verification locally for testing

This commit is contained in:
Constantin Graf
2026-06-11 10:17:56 +02:00
committed by Constantin Graf
parent 111ce94150
commit 24c94af952
3 changed files with 37 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ class EnsureEmailIsVerified
*/
public function handle(Request $request, Closure $next, ?string $redirectToRoute = null): Response
{
if (! app()->isLocal()) {
if (! app()->isLocal() || config('app.local_email_verification')) {
if ($request->user() === null ||
(! $request->user()->hasVerifiedEmail())) {
return $request->expectsJson()