login page + i18n

This commit is contained in:
core 2023-02-20 21:56:17 -05:00
parent 918d81b03f
commit 638ed31b09
Signed by: core
GPG Key ID: FDBF740DADDCEECF
5 changed files with 27 additions and 3 deletions

View File

@ -14,6 +14,9 @@
"title": "Log in to your account", "title": "Log in to your account",
"subtitle": "We'll send you an email with a \"magic link\".", "subtitle": "We'll send you an email with a \"magic link\".",
"prompt": "What's your email?", "prompt": "What's your email?",
"actionButtonText": "Log in" "actionButtonText": "Log in",
"apierror": {
"authorization was provided but it is expired or invalid": "User does not exist, maybe consider creating an account?"
}
} }
} }

View File

@ -9,5 +9,14 @@
"lightMode": "ライトモード", "lightMode": "ライトモード",
"darkMode": "ダークモード", "darkMode": "ダークモード",
"changeLang": "言語の変更" "changeLang": "言語の変更"
},
"login": {
"title": "あなたのアカウントにログイン",
"subtitle": "「マジックリンク」を記載したメールをお送りします。",
"prompt": "あなたのメールは何ですか?",
"actionButtonText": "ログイン",
"apierror": {
"authorization was provided but it is expired or invalid": "ユーザーが存在しません。アカウントの作成を検討してください。"
}
} }
} }

View File

@ -9,5 +9,14 @@
"lightMode": "Lichtmodus", "lightMode": "Lichtmodus",
"darkMode": "Donkere modus", "darkMode": "Donkere modus",
"changeLang": "Taal wijzigen" "changeLang": "Taal wijzigen"
},
"login": {
"title": "Log in op jouw account",
"subtitle": "We sturen je een e-mail met een \"magische link\".",
"prompt": "Wat is jouw e-mail?",
"actionButtonText": "Log in",
"apierror": {
"authorization was provided but it is expired or invalid": "Gebruiker bestaat niet, misschien overwegen om een account aan te maken?"
}
} }
} }

View File

@ -25,7 +25,10 @@
if (xhr.status != 200) { if (xhr.status != 200) {
// error // error
hasError = true; hasError = true;
error = JSON.parse(xhr.responseText).errors[0].message; const rawerror = JSON.parse(xhr.responseText).errors[0].message;
error = t(`login.apierror.${rawerror}`);
isloading = false; isloading = false;
} else { } else {
isloading = false; isloading = false;

View File

@ -1,7 +1,7 @@
listen_port = 8000 listen_port = 8000
db_url = "postgres://postgres@localhost/trifidapi" db_url = "postgres://postgres@localhost/trifidapi"
base = "http://localhost:8000" base = "http://localhost:8000"
web_root = "http://localhost:5173 web_root = "http://localhost:5173"
magic_links_valid_for = 86400 magic_links_valid_for = 86400
session_tokens_valid_for = 86400 session_tokens_valid_for = 86400
totp_verification_valid_for = 3600 totp_verification_valid_for = 3600