fix(alpha): correctly set redirect route when logout is triggered (#5288)

This commit is contained in:
Jarrod Flesch
2024-03-10 22:35:06 -04:00
committed by GitHub
parent a5fb8b20a1
commit faa49f36e7

View File

@@ -51,9 +51,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
const redirectToInactivityRoute = useCallback(() => {
if (window.location.pathname.startsWith(admin)) {
const redirectParam = `?redirect=${encodeURIComponent(
window.location.pathname.replace(admin, ''),
)}`
const redirectParam = `?redirect=${encodeURIComponent(window.location.pathname)}`
router.replace(`${admin}${logoutInactivityRoute}${redirectParam}`)
} else {
router.replace(`${admin}${logoutInactivityRoute}`)