From a6444b5b33b275f103ab8ca5db11a4c9d039f93f Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Wed, 12 Nov 2025 23:33:02 +0530 Subject: [PATCH] feat: supported updating email address for Readest account (#2437) --- .../public/locales/ar/translation.json | 11 +- .../public/locales/bn/translation.json | 11 +- .../public/locales/bo/translation.json | 11 +- .../public/locales/de/translation.json | 11 +- .../public/locales/el/translation.json | 11 +- .../public/locales/es/translation.json | 11 +- .../public/locales/fa/translation.json | 11 +- .../public/locales/fr/translation.json | 11 +- .../public/locales/hi/translation.json | 11 +- .../public/locales/id/translation.json | 11 +- .../public/locales/it/translation.json | 11 +- .../public/locales/ja/translation.json | 11 +- .../public/locales/ko/translation.json | 11 +- .../public/locales/nl/translation.json | 11 +- .../public/locales/pl/translation.json | 11 +- .../public/locales/pt/translation.json | 11 +- .../public/locales/ru/translation.json | 11 +- .../public/locales/si/translation.json | 11 +- .../public/locales/sv/translation.json | 11 +- .../public/locales/ta/translation.json | 11 +- .../public/locales/th/translation.json | 11 +- .../public/locales/tr/translation.json | 11 +- .../public/locales/uk/translation.json | 11 +- .../public/locales/vi/translation.json | 11 +- .../public/locales/zh-CN/translation.json | 11 +- .../public/locales/zh-TW/translation.json | 11 +- .../src/app/auth/recovery/page.tsx | 25 ++++ apps/readest-app/src/app/auth/update/page.tsx | 123 ++++++++++++++++++ .../app/user/components/AccountActions.tsx | 10 +- apps/readest-app/src/app/user/page.tsx | 4 +- apps/readest-app/src/hooks/useUserActions.ts | 7 +- apps/readest-app/src/utils/nav.ts | 7 + 32 files changed, 433 insertions(+), 29 deletions(-) create mode 100644 apps/readest-app/src/app/auth/update/page.tsx diff --git a/apps/readest-app/public/locales/ar/translation.json b/apps/readest-app/public/locales/ar/translation.json index a7f6214e..3c9d105f 100644 --- a/apps/readest-app/public/locales/ar/translation.json +++ b/apps/readest-app/public/locales/ar/translation.json @@ -662,5 +662,14 @@ "Quick Colors": "ألوان سريعة", "Highlighter": "محدد النص", "Save Book Cover": "حفظ غلاف الكتاب", - "Auto-save last book cover": "حفظ غلاف الكتاب الأخير تلقائيًا" + "Auto-save last book cover": "حفظ غلاف الكتاب الأخير تلقائيًا", + "Back": "عودة", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "تم إرسال بريد التأكيد! يرجى التحقق من عناوين بريدك الإلكتروني القديمة والجديدة لتأكيد التغيير.", + "Failed to update email": "فشل في تحديث البريد الإلكتروني", + "New Email": "البريد الإلكتروني الجديد", + "Your new email": "بريدك الإلكتروني الجديد", + "Updating email ...": "جارٍ تحديث البريد الإلكتروني ...", + "Update email": "تحديث البريد الإلكتروني", + "Current email": "البريد الإلكتروني الحالي", + "Update Email": "تحديث البريد الإلكتروني" } diff --git a/apps/readest-app/public/locales/bn/translation.json b/apps/readest-app/public/locales/bn/translation.json index 1218b970..bd9a930c 100644 --- a/apps/readest-app/public/locales/bn/translation.json +++ b/apps/readest-app/public/locales/bn/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "দ্রুত রংসমূহ", "Highlighter": "হাইলাইটার", "Save Book Cover": "বইয়ের মলাট সংরক্ষণ করুন", - "Auto-save last book cover": "শেষ বইয়ের মলাট স্বয়ংক্রিয়ভাবে সংরক্ষণ করুন" + "Auto-save last book cover": "শেষ বইয়ের মলাট স্বয়ংক্রিয়ভাবে সংরক্ষণ করুন", + "Back": "পেছনে", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "নিশ্চিতকরণ ইমেল পাঠানো হয়েছে! পরিবর্তন নিশ্চিত করতে আপনার পুরানো এবং নতুন ইমেল ঠিকানা পরীক্ষা করুন।", + "Failed to update email": "ইমেল আপডেট করতে ব্যর্থ", + "New Email": "নতুন ইমেল", + "Your new email": "আপনার নতুন ইমেল", + "Updating email ...": "ইমেল আপডেট হচ্ছে ...", + "Update email": "ইমেল আপডেট করুন", + "Current email": "বর্তমান ইমেল", + "Update Email": "ইমেল আপডেট করুন" } diff --git a/apps/readest-app/public/locales/bo/translation.json b/apps/readest-app/public/locales/bo/translation.json index e7c26f75..8170ca34 100644 --- a/apps/readest-app/public/locales/bo/translation.json +++ b/apps/readest-app/public/locales/bo/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "མྱུར་ཚོན།", "Highlighter": "མདོག་ཚད་ཀྱི་བསྡུར་བ།", "Save Book Cover": "དེབ་གནས་བཅས་པའི་སྤྱོད་བྱས་མ་ཐུབ།", - "Auto-save last book cover": "དེབ་གནས་བཅས་པའི་སྤྱོད་བྱས་མ་ཐུབ།" + "Auto-save last book cover": "དེབ་གནས་བཅས་པའི་སྤྱོད་བྱས་མ་ཐུབ།", + "Back": "ལོག་བྱེད།", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "གཏན་འཁེལ་ཡིག་འཕྲིན་བཏང་ཡོད། ཡིག་འཕྲིན་རྣམས་གཉིས་ལ་བལྟས་ནས་བརྗེ་བ་དེ་གཏན་འཁེལ་བྱོས།", + "Failed to update email": "ཡིག་འཕྲིན་གསར་བསྒྱུར་ཕམ་པ།", + "New Email": "ཡིག་འཕྲིན་གསར་པ།", + "Your new email": "ཁྱེད་ཀྱི་ཡིག་འཕྲིན་གསར་པ།", + "Updating email ...": "ཡིག་འཕྲིན་གསར་བསྒྱུར་བཞིན་པ། ...", + "Update email": "ཡིག་འཕྲིན་གསར་བསྒྱུར།", + "Current email": "མིག་སྔའི་ཡིག་འཕྲིན།", + "Update Email": "ཡིག་འཕྲིན་གསར་བསྒྱུར།" } diff --git a/apps/readest-app/public/locales/de/translation.json b/apps/readest-app/public/locales/de/translation.json index 8ead8ba2..592a32f2 100644 --- a/apps/readest-app/public/locales/de/translation.json +++ b/apps/readest-app/public/locales/de/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "Schnellfarben", "Highlighter": "Textmarker", "Save Book Cover": "Buchcover speichern", - "Auto-save last book cover": "Letztes Buchcover automatisch speichern" + "Auto-save last book cover": "Letztes Buchcover automatisch speichern", + "Back": "Zurück", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Bestätigungs-E-Mail gesendet! Bitte überprüfe deine alte und neue E-Mail-Adresse, um die Änderung zu bestätigen.", + "Failed to update email": "E-Mail konnte nicht aktualisiert werden", + "New Email": "Neue E-Mail", + "Your new email": "Deine neue E-Mail-Adresse", + "Updating email ...": "E-Mail wird aktualisiert ...", + "Update email": "E-Mail aktualisieren", + "Current email": "Aktuelle E-Mail", + "Update Email": "E-Mail aktualisieren" } diff --git a/apps/readest-app/public/locales/el/translation.json b/apps/readest-app/public/locales/el/translation.json index df4bee83..79e97c51 100644 --- a/apps/readest-app/public/locales/el/translation.json +++ b/apps/readest-app/public/locales/el/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "Γρήγορα χρώματα", "Highlighter": "Υπογραμμιστής", "Save Book Cover": "Αποθήκευση εξωφύλλου βιβλίου", - "Auto-save last book cover": "Αυτόματη αποθήκευση τελευταίου εξωφύλλου βιβλίου" + "Auto-save last book cover": "Αυτόματη αποθήκευση τελευταίου εξωφύλλου βιβλίου", + "Back": "Πίσω", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Το email επιβεβαίωσης στάλθηκε! Παρακαλώ έλεγξε την παλιά και τη νέα σου διεύθυνση email για να επιβεβαιώσεις την αλλαγή.", + "Failed to update email": "Αποτυχία ενημέρωσης email", + "New Email": "Νέο email", + "Your new email": "Το νέο σου email", + "Updating email ...": "Ενημέρωση email ...", + "Update email": "Ενημέρωση email", + "Current email": "Τρέχον email", + "Update Email": "Ενημέρωση email" } diff --git a/apps/readest-app/public/locales/es/translation.json b/apps/readest-app/public/locales/es/translation.json index 01999160..2329d047 100644 --- a/apps/readest-app/public/locales/es/translation.json +++ b/apps/readest-app/public/locales/es/translation.json @@ -650,5 +650,14 @@ "Quick Colors": "Colores Rápidos", "Highlighter": "Resaltador", "Save Book Cover": "Guardar Portada del Libro", - "Auto-save last book cover": "Guardar automáticamente la última portada del libro" + "Auto-save last book cover": "Guardar automáticamente la última portada del libro", + "Back": "Atrás", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "¡Correo de confirmación enviado! Por favor, revisa tus direcciones de correo electrónico antigua y nueva para confirmar el cambio.", + "Failed to update email": "Error al actualizar el correo electrónico", + "New Email": "Nuevo correo electrónico", + "Your new email": "Tu nuevo correo electrónico", + "Updating email ...": "Actualizando correo electrónico ...", + "Update email": "Actualizar correo electrónico", + "Current email": "Correo electrónico actual", + "Update Email": "Actualizar correo electrónico" } diff --git a/apps/readest-app/public/locales/fa/translation.json b/apps/readest-app/public/locales/fa/translation.json index dcb64c4d..c803a5b5 100644 --- a/apps/readest-app/public/locales/fa/translation.json +++ b/apps/readest-app/public/locales/fa/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "رنگ‌های سریع", "Highlighter": "ماژیک هایلایت", "Save Book Cover": "ذخیره جلد کتاب", - "Auto-save last book cover": "ذخیره خودکار آخرین جلد کتاب" + "Auto-save last book cover": "ذخیره خودکار آخرین جلد کتاب", + "Back": "بازگشت", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "ایمیل تأیید ارسال شد! لطفاً ایمیل قدیمی و جدید خود را بررسی کنید تا تغییر را تأیید نمایید.", + "Failed to update email": "به‌روزرسانی ایمیل ناموفق بود", + "New Email": "ایمیل جدید", + "Your new email": "ایمیل جدید شما", + "Updating email ...": "در حال به‌روزرسانی ایمیل ...", + "Update email": "به‌روزرسانی ایمیل", + "Current email": "ایمیل فعلی", + "Update Email": "به‌روزرسانی ایمیل" } diff --git a/apps/readest-app/public/locales/fr/translation.json b/apps/readest-app/public/locales/fr/translation.json index 8a6ca0d2..994d64d5 100644 --- a/apps/readest-app/public/locales/fr/translation.json +++ b/apps/readest-app/public/locales/fr/translation.json @@ -650,5 +650,14 @@ "Quick Colors": "Couleurs Rapides", "Highlighter": "Surligneur", "Save Book Cover": "Enregistrer la Couverture du Livre", - "Auto-save last book cover": "Enregistrer automatiquement la dernière couverture du livre" + "Auto-save last book cover": "Enregistrer automatiquement la dernière couverture du livre", + "Back": "Retour", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "E-mail de confirmation envoyé ! Veuillez vérifier vos anciennes et nouvelles adresses e-mail pour confirmer le changement.", + "Failed to update email": "Échec de la mise à jour de l’e-mail", + "New Email": "Nouvel e-mail", + "Your new email": "Votre nouvel e-mail", + "Updating email ...": "Mise à jour de l’e-mail ...", + "Update email": "Mettre à jour l’e-mail", + "Current email": "E-mail actuel", + "Update Email": "Mettre à jour l’e-mail" } diff --git a/apps/readest-app/public/locales/hi/translation.json b/apps/readest-app/public/locales/hi/translation.json index 52a901d5..479dc426 100644 --- a/apps/readest-app/public/locales/hi/translation.json +++ b/apps/readest-app/public/locales/hi/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "त्वरित रंग", "Highlighter": "हाइलाइटर", "Save Book Cover": "बुक कवर सहेजें", - "Auto-save last book cover": "अंतिम पुस्तक कवर को स्वचालित रूप से सहेजें" + "Auto-save last book cover": "अंतिम पुस्तक कवर को स्वचालित रूप से सहेजें", + "Back": "वापस", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "पुष्टिकरण ईमेल भेज दिया गया है! कृपया परिवर्तन की पुष्टि करने के लिए अपना पुराना और नया ईमेल पता जांचें।", + "Failed to update email": "ईमेल अपडेट करने में विफल", + "New Email": "नया ईमेल", + "Your new email": "आपका नया ईमेल", + "Updating email ...": "ईमेल अपडेट किया जा रहा है ...", + "Update email": "ईमेल अपडेट करें", + "Current email": "वर्तमान ईमेल", + "Update Email": "ईमेल अपडेट करें" } diff --git a/apps/readest-app/public/locales/id/translation.json b/apps/readest-app/public/locales/id/translation.json index 9cc5d513..24c074ec 100644 --- a/apps/readest-app/public/locales/id/translation.json +++ b/apps/readest-app/public/locales/id/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "Warna Cepat", "Highlighter": "Penyorot", "Save Book Cover": "Simpan Sampul Buku", - "Auto-save last book cover": "Simpan otomatis sampul buku terakhir" + "Auto-save last book cover": "Simpan otomatis sampul buku terakhir", + "Back": "Kembali", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Email konfirmasi telah dikirim! Silakan periksa alamat email lama dan baru Anda untuk mengonfirmasi perubahan.", + "Failed to update email": "Gagal memperbarui email", + "New Email": "Email baru", + "Your new email": "Email baru Anda", + "Updating email ...": "Memperbarui email ...", + "Update email": "Perbarui email", + "Current email": "Email saat ini", + "Update Email": "Perbarui email" } diff --git a/apps/readest-app/public/locales/it/translation.json b/apps/readest-app/public/locales/it/translation.json index 93e5475c..f6dbdf80 100644 --- a/apps/readest-app/public/locales/it/translation.json +++ b/apps/readest-app/public/locales/it/translation.json @@ -650,5 +650,14 @@ "Quick Colors": "Colori Veloci", "Highlighter": "Evidenziatore", "Save Book Cover": "Salva Copertina del Libro", - "Auto-save last book cover": "Salva automaticamente l'ultima copertina del libro" + "Auto-save last book cover": "Salva automaticamente l'ultima copertina del libro", + "Back": "Indietro", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Email di conferma inviata! Controlla il tuo vecchio e nuovo indirizzo email per confermare la modifica.", + "Failed to update email": "Aggiornamento dell'email non riuscito", + "New Email": "Nuova email", + "Your new email": "La tua nuova email", + "Updating email ...": "Aggiornamento dell'email ...", + "Update email": "Aggiorna email", + "Current email": "Email attuale", + "Update Email": "Aggiorna email" } diff --git a/apps/readest-app/public/locales/ja/translation.json b/apps/readest-app/public/locales/ja/translation.json index c05f1b2c..91e1de70 100644 --- a/apps/readest-app/public/locales/ja/translation.json +++ b/apps/readest-app/public/locales/ja/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "クイックカラー", "Highlighter": "蛍光ペン", "Save Book Cover": "本のカバーを保存", - "Auto-save last book cover": "最後の本のカバーを自動保存" + "Auto-save last book cover": "最後の本のカバーを自動保存", + "Back": "戻る", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "確認メールを送信しました。変更を確認するために、古いメールアドレスと新しいメールアドレスを確認してください。", + "Failed to update email": "メールの更新に失敗しました", + "New Email": "新しいメールアドレス", + "Your new email": "あなたの新しいメールアドレス", + "Updating email ...": "メールを更新しています ...", + "Update email": "メールを更新", + "Current email": "現在のメールアドレス", + "Update Email": "メールを更新" } diff --git a/apps/readest-app/public/locales/ko/translation.json b/apps/readest-app/public/locales/ko/translation.json index 53ea4c68..5e100d6b 100644 --- a/apps/readest-app/public/locales/ko/translation.json +++ b/apps/readest-app/public/locales/ko/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "빠른 색상", "Highlighter": "형광펜", "Save Book Cover": "책 표지 저장", - "Auto-save last book cover": "마지막 책 표지 자동 저장" + "Auto-save last book cover": "마지막 책 표지 자동 저장", + "Back": "뒤로", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "확인 이메일이 전송되었습니다! 변경을 확인하려면 이전 이메일 주소와 새 이메일 주소를 확인하세요.", + "Failed to update email": "이메일 업데이트 실패", + "New Email": "새 이메일", + "Your new email": "새 이메일 주소", + "Updating email ...": "이메일 업데이트 중...", + "Update email": "이메일 업데이트", + "Current email": "현재 이메일", + "Update Email": "이메일 업데이트" } diff --git a/apps/readest-app/public/locales/nl/translation.json b/apps/readest-app/public/locales/nl/translation.json index ba9dd90a..62d4b86d 100644 --- a/apps/readest-app/public/locales/nl/translation.json +++ b/apps/readest-app/public/locales/nl/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "Snelle kleuren", "Highlighter": "Marker", "Save Book Cover": "Opslaan boekomslag", - "Auto-save last book cover": "Automatisch opslaan laatste boekomslag" + "Auto-save last book cover": "Automatisch opslaan laatste boekomslag", + "Back": "Terug", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Bevestigingsmail verzonden! Controleer je oude en nieuwe e-mailadres om de wijziging te bevestigen.", + "Failed to update email": "E-mail bijwerken mislukt", + "New Email": "Nieuw e-mailadres", + "Your new email": "Je nieuwe e-mailadres", + "Updating email ...": "E-mail wordt bijgewerkt...", + "Update email": "E-mail bijwerken", + "Current email": "Huidig e-mailadres", + "Update Email": "E-mail bijwerken" } diff --git a/apps/readest-app/public/locales/pl/translation.json b/apps/readest-app/public/locales/pl/translation.json index 01b00a14..ab498929 100644 --- a/apps/readest-app/public/locales/pl/translation.json +++ b/apps/readest-app/public/locales/pl/translation.json @@ -654,5 +654,14 @@ "Quick Colors": "Szybkie kolory", "Highlighter": "Zakreślacz", "Save Book Cover": "Zapisz okładkę książki", - "Auto-save last book cover": "Automatyczne zapisywanie ostatniej okładki książki" + "Auto-save last book cover": "Automatyczne zapisywanie ostatniej okładki książki", + "Back": "Wstecz", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "E-mail potwierdzający został wysłany! Sprawdź swój stary i nowy adres e-mail, aby potwierdzić zmianę.", + "Failed to update email": "Nie udało się zaktualizować e-maila", + "New Email": "Nowy e-mail", + "Your new email": "Twój nowy adres e-mail", + "Updating email ...": "Aktualizowanie e-maila...", + "Update email": "Zaktualizuj e-mail", + "Current email": "Obecny e-mail", + "Update Email": "Zaktualizuj e-mail" } diff --git a/apps/readest-app/public/locales/pt/translation.json b/apps/readest-app/public/locales/pt/translation.json index d7f22aab..15817fb7 100644 --- a/apps/readest-app/public/locales/pt/translation.json +++ b/apps/readest-app/public/locales/pt/translation.json @@ -650,5 +650,14 @@ "Quick Colors": "Cores rápidas", "Highlighter": "Marcador", "Save Book Cover": "Salvar Capa do Livro", - "Auto-save last book cover": "Salvar automaticamente a última capa do livro" + "Auto-save last book cover": "Salvar automaticamente a última capa do livro", + "Back": "Voltar", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "E-mail de confirmação enviado! Verifique os seus endereços de e-mail antigo e novo para confirmar a alteração.", + "Failed to update email": "Falha ao atualizar o e-mail", + "New Email": "Novo e-mail", + "Your new email": "O seu novo e-mail", + "Updating email ...": "A atualizar o e-mail...", + "Update email": "Atualizar e-mail", + "Current email": "E-mail atual", + "Update Email": "Atualizar e-mail" } diff --git a/apps/readest-app/public/locales/ru/translation.json b/apps/readest-app/public/locales/ru/translation.json index 4e52d4c5..6fa9434d 100644 --- a/apps/readest-app/public/locales/ru/translation.json +++ b/apps/readest-app/public/locales/ru/translation.json @@ -654,5 +654,14 @@ "Quick Colors": "Быстрые цвета", "Highlighter": "Маркер", "Save Book Cover": "Сохранить обложку книги", - "Auto-save last book cover": "Автоматически сохранять последнюю обложку книги" + "Auto-save last book cover": "Автоматически сохранять последнюю обложку книги", + "Back": "Назад", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Письмо с подтверждением отправлено! Пожалуйста, проверьте старый и новый адреса электронной почты, чтобы подтвердить изменение.", + "Failed to update email": "Не удалось обновить электронную почту", + "New Email": "Новый адрес электронной почты", + "Your new email": "Ваш новый адрес электронной почты", + "Updating email ...": "Обновление электронной почты ...", + "Update email": "Обновить электронную почту", + "Current email": "Текущий адрес электронной почты", + "Update Email": "Обновить электронную почту" } diff --git a/apps/readest-app/public/locales/si/translation.json b/apps/readest-app/public/locales/si/translation.json index 28d5a3c6..ee8f88fb 100644 --- a/apps/readest-app/public/locales/si/translation.json +++ b/apps/readest-app/public/locales/si/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "ක්ෂණික වර්ණ", "Highlighter": "ඉස්මතු කරන්නා", "Save Book Cover": "පොත් ආවරණය සුරකින්න", - "Auto-save last book cover": "අවසන් පොත් ආවරණය ස්වයංක්‍රීයව සුරකින්න" + "Auto-save last book cover": "අවසන් පොත් ආවරණය ස්වයංක්‍රීයව සුරකින්න", + "Back": "ආපසු", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "තහවුරු කිරීමේ විද්‍යුත් තැපැල් පණිවිඩය යවන්නා! වෙනස්කම තහවුරු කිරීම සඳහා ඔබගේ පැරණි සහ නව විද්‍යුත් තැපැල් ලිපින පරීක්ෂා කරන්න.", + "Failed to update email": "විද්‍යුත් තැපැල් යාවත්කාලීන කිරීමට අසමත් විය", + "New Email": "නව විද්‍යුත් තැපැල්", + "Your new email": "ඔබේ නව විද්‍යුත් තැපැල්", + "Updating email ...": "විද්‍යුත් තැපැල් යාවත්කාලීන කරමින් ...", + "Update email": "විද්‍යුත් තැපැල් යාවත්කාලීන කරන්න", + "Current email": "වත්මන් විද්‍යුත් තැපැල්", + "Update Email": "විද්‍යුත් තැපැල් යාවත්කාලීන කරන්න" } diff --git a/apps/readest-app/public/locales/sv/translation.json b/apps/readest-app/public/locales/sv/translation.json index d0e69e7d..df5f6b9f 100644 --- a/apps/readest-app/public/locales/sv/translation.json +++ b/apps/readest-app/public/locales/sv/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "Snabba färger", "Highlighter": "Markeringspenna", "Save Book Cover": "Spara bokomslag", - "Auto-save last book cover": "Automatiskt spara senaste bokomslag" + "Auto-save last book cover": "Automatiskt spara senaste bokomslag", + "Back": "Tillbaka", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Bekräftelsemail skickat! Kontrollera din gamla och nya e-postadress för att bekräfta ändringen.", + "Failed to update email": "Misslyckades med att uppdatera e-post", + "New Email": "Ny e-post", + "Your new email": "Din nya e-post", + "Updating email ...": "Uppdaterar e-post ...", + "Update email": "Uppdatera e-post", + "Current email": "Nuvarande e-post", + "Update Email": "Uppdatera e-post" } diff --git a/apps/readest-app/public/locales/ta/translation.json b/apps/readest-app/public/locales/ta/translation.json index 23531a33..dd385923 100644 --- a/apps/readest-app/public/locales/ta/translation.json +++ b/apps/readest-app/public/locales/ta/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "விரைவு நிறங்கள்", "Highlighter": "ஹைலைட்டர்", "Save Book Cover": "புத்தகக் கோப்பைச் சேமிக்கவும்", - "Auto-save last book cover": "அවසන් புத்தகக் கோப்பு காலியாக உள்ளது" + "Auto-save last book cover": "அවසන් புத்தகக் கோப்பு காலியாக உள்ளது", + "Back": "பின் செல்ல", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "உறுதிப்பத்திர மின்னஞ்சல் அனுப்பப்பட்டுள்ளது! மாற்றத்தை உறுதிப்படுத்த உங்கள் பழைய மற்றும் புதிய மின்னஞ்சல் முகவரிகளை சரிபார்க்கவும்.", + "Failed to update email": "மின்னஞ்சல் புதுப்பிப்பில் தோல்வி", + "New Email": "புதிய மின்னஞ்சல்", + "Your new email": "உங்கள் புதிய மின்னஞ்சல்", + "Updating email ...": "மின்னஞ்சல் புதுப்பிக்கப்படுகிறது ...", + "Update email": "மின்னஞ்சல் புதுப்பிக்கவும்", + "Current email": "தற்போதைய மின்னஞ்சல்", + "Update Email": "மின்னஞ்சல் புதுப்பிக்கவும்" } diff --git a/apps/readest-app/public/locales/th/translation.json b/apps/readest-app/public/locales/th/translation.json index bb1c78de..74ce97ab 100644 --- a/apps/readest-app/public/locales/th/translation.json +++ b/apps/readest-app/public/locales/th/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "สีด่วน", "Highlighter": "ปากกาเน้นข้อความ", "Save Book Cover": "บันทึกปกหนังสือ", - "Auto-save last book cover": "บันทึกปกหนังสือสุดท้ายโดยอัตโนมัติ" + "Auto-save last book cover": "บันทึกปกหนังสือสุดท้ายโดยอัตโนมัติ", + "Back": "กลับ", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "ส่งอีเมลยืนยันแล้ว! กรุณาตรวจสอบอีเมลเก่าและใหม่ของคุณเพื่อยืนยันการเปลี่ยนแปลง", + "Failed to update email": "ไม่สามารถอัปเดตอีเมลได้", + "New Email": "อีเมลใหม่", + "Your new email": "อีเมลใหม่ของคุณ", + "Updating email ...": "กำลังอัปเดตอีเมล ...", + "Update email": "อัปเดตอีเมล", + "Current email": "อีเมลปัจจุบัน", + "Update Email": "อัปเดตอีเมล" } diff --git a/apps/readest-app/public/locales/tr/translation.json b/apps/readest-app/public/locales/tr/translation.json index cb7788e4..6571b83c 100644 --- a/apps/readest-app/public/locales/tr/translation.json +++ b/apps/readest-app/public/locales/tr/translation.json @@ -646,5 +646,14 @@ "Quick Colors": "Hızlı Renkler", "Highlighter": "Vurgulayıcı", "Save Book Cover": "Kitap Kapağını Kaydet", - "Auto-save last book cover": "Son kitap kapağını otomatik olarak kaydet" + "Auto-save last book cover": "Son kitap kapağını otomatik olarak kaydet", + "Back": "Geri", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Onay e-postası gönderildi! Değişikliği onaylamak için eski ve yeni e-posta adreslerinizi kontrol edin.", + "Failed to update email": "E-posta güncellenemedi", + "New Email": "Yeni e-posta", + "Your new email": "Yeni e-posta adresiniz", + "Updating email ...": "E-posta güncelleniyor ...", + "Update email": "E-postayı güncelle", + "Current email": "Mevcut e-posta", + "Update Email": "E-postayı güncelle" } diff --git a/apps/readest-app/public/locales/uk/translation.json b/apps/readest-app/public/locales/uk/translation.json index 9d9850d2..a06732f3 100644 --- a/apps/readest-app/public/locales/uk/translation.json +++ b/apps/readest-app/public/locales/uk/translation.json @@ -654,5 +654,14 @@ "Quick Colors": "Швидкі кольори", "Highlighter": "Маркер", "Save Book Cover": "Зберегти обкладинку книги", - "Auto-save last book cover": "Автоматично зберегти останню обкладинку книги" + "Auto-save last book cover": "Автоматично зберегти останню обкладинку книги", + "Back": "Назад", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Лист підтвердження надіслано! Будь ласка, перевірте стару та нову електронну адресу, щоб підтвердити зміну.", + "Failed to update email": "Не вдалося оновити електронну пошту", + "New Email": "Нова електронна пошта", + "Your new email": "Ваша нова електронна адреса", + "Updating email ...": "Оновлення електронної пошти ...", + "Update email": "Оновити електронну пошту", + "Current email": "Поточна електронна пошта", + "Update Email": "Оновити електронну пошту" } diff --git a/apps/readest-app/public/locales/vi/translation.json b/apps/readest-app/public/locales/vi/translation.json index d987278a..c8480e6e 100644 --- a/apps/readest-app/public/locales/vi/translation.json +++ b/apps/readest-app/public/locales/vi/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "Màu nhanh", "Highlighter": "Bút đánh dấu", "Save Book Cover": "Lưu bìa sách", - "Auto-save last book cover": "Tự động lưu bìa sách cuối cùng" + "Auto-save last book cover": "Tự động lưu bìa sách cuối cùng", + "Back": "Quay lại", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "Email xác nhận đã được gửi! Vui lòng kiểm tra địa chỉ email cũ và mới của bạn để xác nhận thay đổi.", + "Failed to update email": "Cập nhật email thất bại", + "New Email": "Email mới", + "Your new email": "Email mới của bạn", + "Updating email ...": "Đang cập nhật email ...", + "Update email": "Cập nhật email", + "Current email": "Email hiện tại", + "Update Email": "Cập nhật email" } diff --git a/apps/readest-app/public/locales/zh-CN/translation.json b/apps/readest-app/public/locales/zh-CN/translation.json index 4e3c70fc..a95ae432 100644 --- a/apps/readest-app/public/locales/zh-CN/translation.json +++ b/apps/readest-app/public/locales/zh-CN/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "快速颜色", "Highlighter": "荧光笔", "Save Book Cover": "保存书籍封面", - "Auto-save last book cover": "自动保存最后一本书的封面" + "Auto-save last book cover": "自动保存最后一本书的封面", + "Back": "返回", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "确认邮件已发送!请检查您的旧邮箱和新邮箱以确认更改。", + "Failed to update email": "更新邮箱失败", + "New Email": "新邮箱", + "Your new email": "您的新邮箱", + "Updating email ...": "正在更新邮箱 ...", + "Update email": "更新邮箱", + "Current email": "当前邮箱", + "Update Email": "更新邮箱" } diff --git a/apps/readest-app/public/locales/zh-TW/translation.json b/apps/readest-app/public/locales/zh-TW/translation.json index 63b2630d..43f40097 100644 --- a/apps/readest-app/public/locales/zh-TW/translation.json +++ b/apps/readest-app/public/locales/zh-TW/translation.json @@ -642,5 +642,14 @@ "Quick Colors": "快速顏色", "Highlighter": "螢光筆", "Save Book Cover": "保存書籍封面", - "Auto-save last book cover": "自動保存最後一本書的封面" + "Auto-save last book cover": "自動保存最後一本書的封面", + "Back": "返回", + "Confirmation email sent! Please check your old and new email addresses to confirm the change.": "確認郵件已發送!請檢查您的舊電子郵件和新電子郵件以確認更改。", + "Failed to update email": "更新電子郵件失敗", + "New Email": "新電子郵件", + "Your new email": "您的新電子郵件", + "Updating email ...": "正在更新電子郵件 ...", + "Update email": "更新電子郵件", + "Current email": "當前電子郵件", + "Update Email": "更新電子郵件" } diff --git a/apps/readest-app/src/app/auth/recovery/page.tsx b/apps/readest-app/src/app/auth/recovery/page.tsx index ff9967b8..5e090e62 100644 --- a/apps/readest-app/src/app/auth/recovery/page.tsx +++ b/apps/readest-app/src/app/auth/recovery/page.tsx @@ -56,6 +56,31 @@ export default function ResetPasswordPage() { providers={[]} localization={getAuthLocalization()} /> + + ); diff --git a/apps/readest-app/src/app/auth/update/page.tsx b/apps/readest-app/src/app/auth/update/page.tsx new file mode 100644 index 00000000..3ecc4d38 --- /dev/null +++ b/apps/readest-app/src/app/auth/update/page.tsx @@ -0,0 +1,123 @@ +'use client'; +import { useState, useEffect } from 'react'; +import { useRouter } from 'next/navigation'; +import { useAuth } from '@/context/AuthContext'; +import { useThemeStore } from '@/store/themeStore'; +import { useTranslation } from '@/hooks/useTranslation'; +import { supabase } from '@/utils/supabase'; + +export default function UpdateEmailPage() { + const _ = useTranslation(); + const router = useRouter(); + const { user } = useAuth(); + const { isDarkMode } = useThemeStore(); + + const [email, setEmail] = useState(''); + const [loading, setLoading] = useState(false); + const [message, setMessage] = useState(''); + const [error, setError] = useState(''); + + useEffect(() => { + if (!user) { + router.push('/login'); + } + }, [user, router]); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + setLoading(true); + setMessage(''); + setError(''); + + try { + const { error: updateError } = await supabase.auth.updateUser({ + email: email, + }); + + if (updateError) throw updateError; + + setMessage( + _( + 'Confirmation email sent! Please check your old and new email addresses to confirm the change.', + ), + ); + setEmail(''); + } catch (err: any) { + setError(err.message || _('Failed to update email')); + } finally { + setLoading(false); + } + }; + + return ( +
+
+
+
+
+ + setEmail(e.target.value)} + placeholder={_('Your new email')} + required + disabled={loading} + className={`w-full rounded-md border bg-transparent px-4 py-2.5 focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 ${isDarkMode ? 'text-gray-300' : 'text-gray-400'}`} + /> +
+ + {error &&
{error}
} + + {message &&
{message}
} + + + + +
+ + {user?.email && ( +
+ {_('Current email')}: {user.email} +
+ )} +
+
+
+ ); +} diff --git a/apps/readest-app/src/app/user/components/AccountActions.tsx b/apps/readest-app/src/app/user/components/AccountActions.tsx index 31b4dfbb..05e29028 100644 --- a/apps/readest-app/src/app/user/components/AccountActions.tsx +++ b/apps/readest-app/src/app/user/components/AccountActions.tsx @@ -49,6 +49,7 @@ interface AccountActionsProps { userPlan: UserPlan; onLogout: () => void; onResetPassword: () => void; + onUpdateEmail: () => void; onConfirmDelete: () => void; onRestorePurchase?: () => void; onManageSubscription?: () => void; @@ -58,6 +59,7 @@ const AccountActions: React.FC = ({ userPlan, onLogout, onResetPassword, + onUpdateEmail, onConfirmDelete, onRestorePurchase, onManageSubscription, @@ -84,7 +86,7 @@ const AccountActions: React.FC = ({ setShowConfirmDelete(false); }} /> -
+
{appService?.hasIAP ? ( +