mirror of
https://github.com/outline/outline.git
synced 2026-11-30 00:50:41 +03:00
fix: post login redirect path not correctly spent, closes #7662
This commit is contained in:
1 parent
9b807f7a9e
commit
ce91071995
1 file changed
+6
-1
@@ -63,7 +63,7 @@ export function usePostLoginPath() {
|
||||
try {
|
||||
path = sessionStorage.getItem(key) || getCookie(key);
|
||||
} catch (e) {
|
||||
// If the session storage is inaccessible, we can't do anything about it.
|
||||
// Expected error if the session storage is full or inaccessible.
|
||||
}
|
||||
|
||||
if (path) {
|
||||
@@ -72,6 +72,11 @@ export function usePostLoginPath() {
|
||||
// Remove the cookie once the app has been navigated to the post login path. We dont
|
||||
// do this immediately as React StrictMode will render multiple times.
|
||||
const cleanup = history.listen(() => {
|
||||
try {
|
||||
sessionStorage.removeItem(key);
|
||||
} catch (e) {
|
||||
// Expected error if the session storage is full or inaccessible.
|
||||
}
|
||||
removeCookie(key);
|
||||
cleanup?.();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user