ShouldResetPasswordMiddleware

public struct ShouldResetPasswordMiddleware<U> : Middleware where U : AdminPanelUserType

Basic middleware to redirect users that needs to reset their password to the supplied path

  • Initialise the ShouldResetPasswordMiddleware

    Declaration

    Swift

    public init(U authenticatableType: U.Type = U.self, path: String)

    Parameters

    authenticatableType

    The type to check if reset password is required

    path

    The path to redirect to if the user needs to reset their password

  • See Middleware.respond.

    Declaration

    Swift

    public func respond(to req: Request, chainingTo next: Responder) throws -> Future<Response>
  • Use this middleware to redirect users away from protected content to a edit page when they need to reset their password

    Declaration

    Swift

    public static func shouldResetPassword(
        path: String = "/admin/users/me/edit"
    ) -> ShouldResetPasswordMiddleware