class EnsureRecoveryCodeIsValid (View source)

Middleware that ensures the password recovery code has been validated before allowing access to sensitive routes, such as password reset pages.

This middleware performs two main checks:

  1. Verifies whether the recovery code was validated in the session.
  2. Ensures that the recovery time window has not expired.

If either condition fails, the user is redirected back to the appropriate recovery step with an error message.

Methods

Response
handle(Request $request, Closure $next)

Handle an incoming request.

Details

Response handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request

the current HTTP request instance

Closure $next

the next middleware or request handler

Return Value

Response

See also

RecoverySessionKey For session key constants used in the password recovery flow.