remix-auth - v5.0.0
    Preparing search index...

    Class Strategy<SessionData, CallbackOptions>Abstract

    The Strategy class is the abstract base class that all authentication strategies must extend.

    Strategies implement the specific authentication logic for different authentication methods (e.g., form-based, OAuth, etc.) and are registered with an Authenticator instance.

    // Example of a custom strategy implementation
    class MyCustomStrategy<SessionData> extends Strategy<
    SessionData,
    { username: string; password: string }
    > {
    async authenticate(request: Request): Promise<SessionData> {
    // Implementation details...
    }
    }

    Type Parameters

    • SessionData

      The type of session data that will be returned after authentication

    • CallbackOptions

      The type of parameters that the callback will receive from the strategy

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    Methods

    • The core authentication method that each strategy must implement.

      This method handles the specific authentication flow for the strategy. It extracts the necessary information from the request, validates it, and calls the callback function to authenticate the user.

      Parameters

      • request: Request

        The incoming request to authenticate

      • ...args: unknown[]

      Returns Promise<SessionData>

      A promise that resolves to the authenticated user data

      Appropriate error if authentication fails