Skip to content

Conversation

@tusharpandey13
Copy link
Contributor

Hooks for auth handlers
GH issue: #1895
A POC is present here: https://github.com/auth0/nextjs-auth0/tree/poc/new-hooks

The following hooks are added to client.ts (and hence, to auth-client.ts):

    beforeLogin?: BeforeLoginHook;
    afterLogin?: AfterLoginHook;
    beforeLogout?: BeforeLogoutHook;
    afterLogout?: AfterLogoutHook;
    beforeCallback?: BeforeCallbackHook;

and can be defined on initalization.

Type definitions and hooks implementation is present in auth-hooks.ts and all hooks return a Promise<NextResponse | void> to factor for both redirection / mutation operations.

@tusharpandey13 tusharpandey13 requested a review from a team as a code owner June 2, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants