mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-17 19:12:03 +00:00
fix: harden review findings and Netlify install
This commit is contained in:
@@ -108,10 +108,7 @@
|
||||
|
||||
successMessage = 'Password updated successfully! Redirecting to sign in...';
|
||||
sessionStorage.removeItem(recoveryMarkerKey);
|
||||
setTimeout(async () => {
|
||||
await supabase.auth.signOut();
|
||||
await goto('/signin');
|
||||
}, 1_000);
|
||||
setTimeout(() => void finishPasswordReset(), 1_000);
|
||||
} catch (err) {
|
||||
console.error('Update password error:', err);
|
||||
errorMessage = 'An unexpected error occurred. Please try again.';
|
||||
@@ -120,6 +117,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function finishPasswordReset() {
|
||||
try {
|
||||
const { error } = await supabase.auth.signOut();
|
||||
if (error) {
|
||||
errorMessage = `Password updated, but sign out failed: ${error.message}`;
|
||||
return;
|
||||
}
|
||||
await goto('/signin');
|
||||
} catch (error) {
|
||||
console.error('Sign out after password reset failed:', error);
|
||||
errorMessage = 'Password updated, but sign out failed. Please try again.';
|
||||
}
|
||||
}
|
||||
|
||||
function handleKeyPress(event: KeyboardEvent) {
|
||||
if (event.key === 'Enter') {
|
||||
updatePassword();
|
||||
|
||||
Reference in New Issue
Block a user