Fix gallery issues: user uploads, error messages, and translations
- Fix user upload feature not showing in gallery - Add allow_user_uploads and upload_category_id to auth response - These fields are required for the gallery to show the upload button - Improve gallery login error messages - Add specific translations for wrong password vs rate limiting - Map backend error messages to user-friendly translations - Added auth.wrongPassword and auth.tooManyAttempts keys - Gallery pages already have full translation support - GalleryPage and GalleryView use i18n properly - All text is translated based on selected language These fixes resolve: 1. User upload button not showing even when enabled 2. Generic error messages for wrong passwords 3. No feedback for rate limiting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit is contained in:
@@ -66,7 +66,16 @@ export const GalleryPage: React.FC = () => {
|
||||
success: true
|
||||
});
|
||||
} catch (error: any) {
|
||||
setLoginError(error.response?.data?.error || t('auth.invalidPassword'));
|
||||
const errorMessage = error.response?.data?.error || 'Invalid password';
|
||||
|
||||
// Map backend error messages to user-friendly translations
|
||||
if (errorMessage.toLowerCase().includes('invalid password')) {
|
||||
setLoginError(t('auth.wrongPassword'));
|
||||
} else if (error.response?.status === 429 || errorMessage.toLowerCase().includes('too many')) {
|
||||
setLoginError(t('auth.tooManyAttempts'));
|
||||
} else {
|
||||
setLoginError(t('auth.invalidPassword'));
|
||||
}
|
||||
|
||||
// Track failed password entry
|
||||
analyticsService.trackGalleryEvent('password_entry', {
|
||||
|
||||
Reference in New Issue
Block a user