Skip to content

Commit 575fb20

Browse files
committed
fix(account): clear route cache after restoration to prevent unintended redirects
Previously, the stored route in sessionStorage was only cleared when invalid. This caused users to be unexpectedly redirected to a previously cached route when manually navigating to the account center homepage.
1 parent 24f48bf commit 575fb20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/account/src/utils/account-center-route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ export const handleAccountCenterRoute = () => {
115115
// Restore the stored route if the current path is the base path.
116116
if (window.location.pathname === accountCenterBasePath) {
117117
const storedRoute = parseStoredRoute(sessionStorage.getItem(routeStorageKey) ?? undefined);
118+
// Always clear the stored route to ensure one-time restoration
119+
sessionStorage.removeItem(routeStorageKey);
120+
118121
if (!storedRoute) {
119-
sessionStorage.removeItem(routeStorageKey);
120122
return;
121123
}
122124

0 commit comments

Comments
 (0)