We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I've added the signout process on a Nuxt3 app last week and even if it works, I'm still not sure if I did it the right way or not.
Note that I did not code the login part and that I read thoroughly this discussion before starting to dev nextauthjs/next-auth#3938
First I modified my server/api/auth/[...].ts to modify the callbacks session and jwt to make the IdToken available.
server/api/auth/[...].ts
session
jwt
Then to logout it's quite easy :
const { data: authData } = useAuth(); const idToken = (authData.value as any)?.idToken; const redirectUrl = runtimeConfig.public.AUTH_ORIGIN; const endSessionUrl = `${runtimeConfig.public.AUTH_ISSUER_IDSERVER}/connect/endsession?id_token_hint=${idToken}&post_logout_redirect_uri=${redirectUrl}`; await signOut({ redirect: false }); window.location.href = endSessionUrl;
So I call signOut first with no callback and end with a redirect to the endsession which will redirect me to my signin page if all goes well.
signOut
Thanks in advance.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I've added the signout process on a Nuxt3 app last week and even if it works, I'm still not sure if I did it the right way or not.
Note that I did not code the login part and that I read thoroughly this discussion before starting to dev nextauthjs/next-auth#3938
First I modified my
server/api/auth/[...].ts
to modify the callbackssession
andjwt
to make the IdToken available.Then to logout it's quite easy :
So I call
signOut
first with no callback and end with a redirect to the endsession which will redirect me to my signin page if all goes well.Thanks in advance.
The text was updated successfully, but these errors were encountered: