fix(sso) - Add redirect_uri to authenticate route on 401 error (#8346)

This commit is contained in:
Meenakshi Kamalaseshan Radha 2023-07-31 09:57:49 +05:30 committed by GitHub
parent 564d8a3760
commit 2ca7f566f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,8 @@ const errorLink = onError((error) => {
if (serverError.statusCode === 401) {
isLoggedInVar(false);
Cookies.remove(GlobalCfg.CLIENT_AUTH_COOKIE);
window.location.replace(PageRoutes.AUTHENTICATE);
const currentPath = window.location.pathname + window.location.search;
window.location.replace(`${PageRoutes.AUTHENTICATE}?redirect_uri=${encodeURIComponent(currentPath)}`);
}
}
if (graphQLErrors && graphQLErrors.length) {