Remix Utils - v9.0.0
    Preparing search index...
    interface HeaderOptions {
        alg?: Algoritm;
        headerName?: string;
        invalidUserMessage?:
            | string
            | object
            | createBearerAuthMiddleware.MessageFunction;
        jwksUri: string
        | URL;
        realm?: string;
        verifyOptions?: JWTVerifyOptions;
    }

    Hierarchy (View Summary)

    Index

    Properties

    alg?: Algoritm

    The algorithm to use for verifying the JWT signature.

    "ES256"
    
    headerName?: string

    The name of the header to use for the bearer token.

    "Authorization"
    
    invalidUserMessage?:
        | string
        | object
        | createBearerAuthMiddleware.MessageFunction

    The message to return when the user is invalid.

    If a function is provided, it will be called with the request and context as arguments.

    If the function returns a string, it will be used as the message.

    If the function returns an object, it will be serialized as JSON and used as the response body.

    "Unauthorized"
    
    "Invalid user"
    (args) => `Invalid user: ${args.request.headers.get("X-User")}`
    async (args) => {
    let user = await getUser(args.context);
    return `Invalid user: ${user}`;
    }
    { error: "Invalid user" }
    (args) => ({
    error: `Invalid user: ${args.request.headers.get("X-User")}`
    })
    async (args) => {
    let user = await getUser(args.context);
    return { error: `Invalid user: ${user}` };
    }
    jwksUri: string | URL

    The URL of the JWKS endpoint.

    "https://auth.example.com/.well-known/jwks.json"
    
    realm?: string

    The domain name of the realm, as part of the returned WWW-Authenticate challenge header.

    "Secure Area"
    
    verifyOptions?: JWTVerifyOptions