MonoCloud Authentication SDK
    Preparing search index...

    Interface MonoCloudMiddlewareOptions

    Options for configuring MonoCloud authentication middleware.

    interface MonoCloudMiddlewareOptions {
        groupsClaim?: string;
        matchAll?: boolean;
        onAccessDenied?: NextMiddlewareOnAccessDenied;
        onError?: (
            req: NextRequest,
            evt: NextFetchEvent,
            error: Error,
        ) => void | NextResponse<unknown> | Promise<void | NextResponse<unknown>>;
        protectedRoutes?: ProtectedRoutes;
    }
    Index

    Properties

    groupsClaim?: string

    The name of the groups claim in the user profile. Default: groups.

    matchAll?: boolean

    If true, user must be a member of all groups. Default: false.

    onAccessDenied?: NextMiddlewareOnAccessDenied

    A middleware function called when the user is not authenticated or is not a member of the specified groups.

    onError?: (
        req: NextRequest,
        evt: NextFetchEvent,
        error: Error,
    ) => void | NextResponse<unknown> | Promise<void | NextResponse<unknown>>

    Error handler for signin, callback, signout and userinfo endpoints.

    Type Declaration

      • (
            req: NextRequest,
            evt: NextFetchEvent,
            error: Error,
        ): void | NextResponse<unknown> | Promise<void | NextResponse<unknown>>
      • Parameters

        • req: NextRequest

          The Next.js request object.

        • evt: NextFetchEvent

          The Next.js FetchEvent.

        • error: Error

          Error occured during execution of the endpoint.

        Returns void | NextResponse<unknown> | Promise<void | NextResponse<unknown>>

        A promise of the response or void

    protectedRoutes?: ProtectedRoutes

    Specifies the routes that require authentication.

    ProtectedRoutes

    If an empty array is passed as the value for the protected routes configuration, no routes will be protected.