fix(web): validate question input before divination and fix logout flow
- Add validation for question text in ManualDivinationPage and AutoDivinationPage - Fix logout flow to call backend API before clearing local auth - Show error message when question is empty before starting interpretation
This commit is contained in:
@@ -21,11 +21,14 @@ export default function SettingsPage({ locale, settings: s }: Props) {
|
||||
if (!confirm(s.logoutConfirm)) return;
|
||||
|
||||
setLogoutLoading(true);
|
||||
// Clear local auth immediately and redirect
|
||||
try {
|
||||
// Call backend logout first (needs auth)
|
||||
await logout();
|
||||
} catch {
|
||||
// Ignore logout API errors
|
||||
}
|
||||
// Clear local auth and redirect
|
||||
clearAuth();
|
||||
// Fire backend logout in background (don't wait)
|
||||
logout().catch(() => {});
|
||||
// Redirect to login
|
||||
redirectToLogin();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user