Closed DaveOrDead closed 8 months ago
export const logout = async (routerClient) => { const authUrl = await routerClient.kindeClient.logout( routerClient.sessionManager, { authUrlParams: Object.fromEntries(routerClient.searchParams) } );
const postLogoutRedirectURL = routerClient.getSearchParam( 'post_logout_redirect_url' );
if (postLogoutRedirectURL) { await routerClient.sessionManager.setSessionItem( 'post_logout_redirect_url', postLogoutRedirectURL ); }
routerClient.redirect(authUrl); };
Think this should do it for pages router, just need to add LogoutLink for app router
Prerequisites
What is the problem you’re trying to solve?
In the same way that dynamic post login urls are allowed, it would be useful to allow the same for logout.
For example to allow both:
What solution would you like to see?
a
post_logout_redirect_uri
parameter that can be passed to the logout url something likeAdditional information
No response