79442247

Date: 2025-02-15 21:14:42
Score: 0.5
Natty:
Report link

Given your use case and based on @raghvendra-n's answer, you could take advantage of post_logout_redirect_uri parameter.

const signOut: JwtAuthContextType['signOut'] = useCallback(() => {
        removeTokenStorageValue();
        removeGlobalHeaders(['Authorization']);
        setAuthState({
            authStatus: 'unauthenticated',
            isAuthenticated: false,
            user: null
        });
        auth.signoutRedirect({post_logout_redirect_uri: "http://host:8080/connect/logout"});
    }, [removeTokenStorageValue]);

What I would like to add, is as can be seen from the code, signoutRedirect needs an absolute path to the URL

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @raghvendra-n's
  • Low reputation (0.5):
Posted by: pratikpc