getAttribute(UserEntity::class); $path = $request->getUri()->getPath(); if ( $this->policy !== 'strict' || strpos($path, '/app/account') === 0 || strpos($path, '/api/account') === 0 || strpos($path, '/api/auth') === 0 || $user->isEmailVerified()->value ) { return $handler->handle($request); } if (strpos($path, '/api') === 0) { return new JsonResponse( [ 'message' => 'Email verification required.' ], StatusCode::FORBIDDEN ); } return new RedirectResponse('/app/account/verification'); } }