AuthRouteHandlers: ((request, contextOrRequest) => Promise<Response | undefined>)

The handler function for handling the GET requests sent to the Auth API routes. Only GET method gets handled, otherwise it rejects.

Type declaration

    • (request, contextOrRequest): Promise<Response | undefined>
    • Parameters

      • request: NextRequest | NextApiRequest

        request can be the following:

        1. a NextRequest when the handler is used in the App Router of Next.js
        2. a NextApiRequest when the handler is used in the Pages Router of Next.js
      • contextOrRequest: AuthRoutesHandlerContext | NextApiResponse

        contextOrRequest can be the following:

        1. a AuthRoutesHandlerContext when the handler is used in the App Router of Next.js
        2. a NextApiResponse when the handler is used in the Pages Router of Next.js

      Returns Promise<Response | undefined>

Returns

a Promise of Response when used in the App Router of Next.js, or returns undefined when used in the Pages Router of Next.js.