Fix OIDC logout not redirecting back to app
Pass id_token_hint explicitly to signoutRedirect() so Authentik honors the post_logout_redirect_uri and sends users back to the app.
This commit is contained in:
parent
e5ce8c1201
commit
a7fa9b81cf
1 changed files with 4 additions and 1 deletions
|
|
@ -15,7 +15,10 @@ export const login = async (): Promise<void> => {
|
||||||
|
|
||||||
export const logout = async (): Promise<void> => {
|
export const logout = async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
await userManager.signoutRedirect();
|
const user = await userManager.getUser();
|
||||||
|
await userManager.signoutRedirect({
|
||||||
|
id_token_hint: user?.id_token,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Logout redirect failed:', error);
|
console.error('Logout redirect failed:', error);
|
||||||
throw parseOidcError(error);
|
throw parseOidcError(error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue