-
Notifications
You must be signed in to change notification settings - Fork 427
Closed
Description
Checklist
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved
In v3, we could customize the auth handlers in /api/auth/[auth0]
via something like:
export const GET = handleAuth({
async logout(req: NextApiRequest, res: NextApiResponse) {
// do custom stuff
return await handleLogout(req, res);
},
});
Reference:
- auth0.github.io/nextjs-auth0/types/handlers_logout.HandleLogout.html
- https://auth0.github.io/nextjs-auth0/modules/handlers.html
I'm not finding that something similar exists in v4.
Describe the ideal solution
Ability to customize the auth handlers in v4.
The handleLogout()
helper is an important piece of this. We need the ability to write our own custom code and then rely on the default auth handler as a fallback, or in addition to our custom code.
Alternatives and current workarounds
Depends on the use case, but as far as I can tell, there is no way to run custom code in the middle of those new auth handlers, /auth/logout
, for example.
Additional context
No response
aMoniker, fdealba, barabicu, iromanro, pkellz and 6 moremrzmyr