mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05:00
🐛 Add correct error mesage when using an expired token.
This commit is contained in:
parent
8a8403834f
commit
2d75efbace
3 changed files with 30 additions and 27 deletions
|
@ -74,18 +74,26 @@
|
|||
(rx/subs
|
||||
(fn [tdata]
|
||||
(handle-token tdata))
|
||||
(fn [error]
|
||||
(case (:code error)
|
||||
:email-already-exists
|
||||
(fn [{:keys [type code] :as error}]
|
||||
(cond
|
||||
(and (= :validation type)
|
||||
(= :invalid-token code)
|
||||
(= :token-expired (:reason error)))
|
||||
(let [msg (tr "errors.token-expired")]
|
||||
(ts/schedule 100 #(st/emit! (dm/error msg)))
|
||||
(st/emit! (rt/nav :auth-login)))
|
||||
|
||||
(= :email-already-exists code)
|
||||
(let [msg (tr "errors.email-already-exists")]
|
||||
(ts/schedule 100 #(st/emit! (dm/error msg)))
|
||||
(st/emit! (rt/nav :auth-login)))
|
||||
|
||||
:email-already-validated
|
||||
(= :email-already-validated code)
|
||||
(let [msg (tr "errors.email-already-validated")]
|
||||
(ts/schedule 100 #(st/emit! (dm/warn msg)))
|
||||
(st/emit! (rt/nav :auth-login)))
|
||||
|
||||
:else
|
||||
(let [msg (tr "errors.generic")]
|
||||
(ts/schedule 100 #(st/emit! (dm/error msg)))
|
||||
(st/emit! (rt/nav :auth-login)))))))))
|
||||
|
|
|
@ -1,25 +1,16 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"PO-Revision-Date: 2021-04-22 13:43+0200\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"PO-Revision-Date: 2021-04-14 13:44+0000\n"
|
||||
"Last-Translator: Andrés Moya <andres.moya@kaleidos.net>\n"
|
||||
"Language-Team: English "
|
||||
"<https://hosted.weblate.org/projects/penpot/frontend/en/>\n"
|
||||
"Language: en\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=iso-8859-1\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.6-dev\n"
|
||||
|
||||
# ~ msgid ""
|
||||
# ~ msgstr ""
|
||||
# ~ "Language: en\n"
|
||||
# ~ "MIME-Version: 1.0\n"
|
||||
# ~ "Content-Type: text/plain; charset=utf-8\n"
|
||||
# ~ "Content-Transfer-Encoding: 8bit\n"
|
||||
# ~ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
#: src/app/main/ui/auth/register.cljs
|
||||
msgid "auth.already-have-account"
|
||||
msgstr "Already have an account?"
|
||||
|
@ -492,6 +483,10 @@ msgstr "The registration is currently disabled."
|
|||
msgid "errors.terms-privacy-agreement-invalid"
|
||||
msgstr "You must accept our terms of service and privacy policy."
|
||||
|
||||
#: src/app/main/ui/auth/verify_token.cljs
|
||||
msgid "errors.token-expired"
|
||||
msgstr "Token expired"
|
||||
|
||||
#: src/app/main/data/media.cljs, src/app/main/ui/workspace/sidebar/options/menus/exports.cljs, src/app/main/ui/handoff/exports.cljs
|
||||
msgid "errors.unexpected-error"
|
||||
msgstr "An unexpected error occurred."
|
||||
|
@ -1068,9 +1063,7 @@ msgstr "Verify new email"
|
|||
|
||||
#: src/app/main/ui/settings/change_email.cljs
|
||||
msgid "modals.change-email.info"
|
||||
msgstr ""
|
||||
"We'll send you an email to your current email “%s” to verify your "
|
||||
"identity."
|
||||
msgstr "We'll send you an email to your current email “%s” to verify your identity."
|
||||
|
||||
#: src/app/main/ui/settings/change_email.cljs
|
||||
msgid "modals.change-email.new-email"
|
||||
|
@ -1094,9 +1087,7 @@ msgstr "Yes, delete my account"
|
|||
|
||||
#: src/app/main/ui/settings/delete_account.cljs
|
||||
msgid "modals.delete-account.info"
|
||||
msgstr ""
|
||||
"By removing your account you’ll lose all your current projects and "
|
||||
"archives."
|
||||
msgstr "By removing your account you’ll lose all your current projects and archives."
|
||||
|
||||
#: src/app/main/ui/settings/delete_account.cljs
|
||||
msgid "modals.delete-account.title"
|
||||
|
|
|
@ -494,6 +494,10 @@ msgstr "El registro está actualmente desactivado."
|
|||
msgid "errors.terms-privacy-agreement-invalid"
|
||||
msgstr "Debes aceptar nuestros términos de servicio y política de privacidad."
|
||||
|
||||
#: src/app/main/ui/auth/verify_token.cljs
|
||||
msgid "errors.token-expired"
|
||||
msgstr "Token expirado"
|
||||
|
||||
#: src/app/main/data/media.cljs, src/app/main/ui/workspace/sidebar/options/menus/exports.cljs, src/app/main/ui/handoff/exports.cljs
|
||||
msgid "errors.unexpected-error"
|
||||
msgstr "Ha ocurrido un error inesperado."
|
||||
|
|
Loading…
Add table
Reference in a new issue