Options
All
  • Public
  • Public/Protected
  • All
Menu

Module handlers/profile

Index

Other Type aliases

Server Type aliases

Other Type aliases

AfterRefetch

AfterRefetch: (req: NextApiRequest, res: NextApiResponse, session: default) => Promise<default> | default

Type declaration

Server Type aliases

HandleProfile

HandleProfile: (req: NextApiRequest, res: NextApiResponse, options?: ProfileOptions) => Promise<void>

The handler for the /api/auth/me route.

throws

HandlerError

Type declaration

    • (req: NextApiRequest, res: NextApiResponse, options?: ProfileOptions): Promise<void>
    • Parameters

      • req: NextApiRequest
      • res: NextApiResponse
      • Optional options: ProfileOptions

      Returns Promise<void>

ProfileOptions

ProfileOptions: { afterRefetch?: AfterRefetch; refetch?: boolean }

Custom options for HandleProfile

Type declaration

  • Optional afterRefetch?: AfterRefetch

    Like {@AfterCallback} and {@AfterRefresh} when a session is created, you can use this function to validate or add/remove claims after the session is updated. Will only run if {@link ProfileOptions.refetch} is true

  • Optional refetch?: boolean

    If set to true this will refetch the user profile information from /userinfo and save it to the session.