fix: replace flyout profile card with logout slider, i18n auth errors
- Replace static account card in mobile flyout with swipe-to-logout widget - Remove redundant logout button from flyout bottom - Make LogoutButton full-width via class prop and dynamic maxSlide - Extract clean GraphQL error messages instead of raw JSON in all auth forms - Add i18n keys for known backend errors (invalid credentials, email taken, invalid token) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,8 @@
|
||||
await login(email, password);
|
||||
goto("/videos", { invalidateAll: true });
|
||||
} catch (err: any) {
|
||||
error = err.message;
|
||||
const raw = err.response?.errors?.[0]?.message ?? err.message;
|
||||
error = raw === "Invalid credentials" ? $_("auth.login.error_invalid_credentials") : raw;
|
||||
isError = true;
|
||||
} finally {
|
||||
isLoading = false;
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
toast.success($_("me.settings.toast_update"));
|
||||
invalidateAll();
|
||||
} catch (err: any) {
|
||||
profileError = err.message;
|
||||
profileError = err.response?.errors?.[0]?.message ?? err.message;
|
||||
isProfileError = true;
|
||||
} finally {
|
||||
isProfileLoading = false;
|
||||
@@ -111,7 +111,7 @@
|
||||
invalidateAll();
|
||||
password = confirmPassword = "";
|
||||
} catch (err: any) {
|
||||
securityError = err.message;
|
||||
securityError = err.response?.errors?.[0]?.message ?? err.message;
|
||||
isSecurityError = true;
|
||||
} finally {
|
||||
isSecurityLoading = false;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
toast.success($_("auth.password_request.toast_request", { values: { email } }));
|
||||
goto("/login");
|
||||
} catch (err: any) {
|
||||
error = err.message;
|
||||
error = err.response?.errors?.[0]?.message ?? err.message;
|
||||
isError = true;
|
||||
} finally {
|
||||
isLoading = false;
|
||||
|
||||
@@ -40,7 +40,9 @@
|
||||
toast.success($_("auth.password_reset.toast_reset"));
|
||||
goto("/login");
|
||||
} catch (err: any) {
|
||||
error = err.message;
|
||||
const raw = err.response?.errors?.[0]?.message ?? err.message;
|
||||
const tokenErrors = ["Invalid or expired reset token", "Reset token expired"];
|
||||
error = tokenErrors.includes(raw) ? $_("auth.password_reset.error_invalid_token") : raw;
|
||||
isError = true;
|
||||
} finally {
|
||||
isLoading = false;
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
toast.success($_("auth.signup.toast_register", { values: { email } }));
|
||||
goto("/login");
|
||||
} catch (err: any) {
|
||||
error = err.message;
|
||||
const raw = err.response?.errors?.[0]?.message ?? err.message;
|
||||
error = raw === "Email already registered" ? $_("auth.signup.error_email_taken") : raw;
|
||||
isError = true;
|
||||
} finally {
|
||||
isLoading = false;
|
||||
|
||||
Reference in New Issue
Block a user