Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions frontend/src/components/AccountMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,27 @@ export function AccountMenu() {
}
};

function signOut() {
os.signOut();
sessionStorage.removeItem("maple_billing_token");
router.invalidate().finally(() => {
router.navigate({ to: "/" });
});
async function signOut() {
try {
// Try to clear billing token first
try {
getBillingService().clearToken();
} catch (error) {
// Fallback to direct session storage removal if billing service fails
sessionStorage.removeItem("maple_billing_token");
}

// Sign out from OpenSecret
await os.signOut();

// Navigate after everything is done
await router.invalidate();
Comment thread
AnthonyRonning marked this conversation as resolved.
await router.navigate({ to: "/" });
} catch (error) {
console.error("Error during sign out:", error);
// Force reload as last resort
window.location.href = "/";
}
}

return (
Expand Down