
{$_('application_name')}
-{$_('log_in_to_your_account')}
+{$_("application_name")}
+{$_("log_in_to_your_account")}
diff --git a/src/components/auth/Login.svelte b/src/components/auth/Login.svelte index 54ccffbc..91623fa9 100644 --- a/src/components/auth/Login.svelte +++ b/src/components/auth/Login.svelte @@ -6,7 +6,7 @@ import { OpenAPI, AuthService } from "@odit/lfk-client-js"; import Footer from "../general/Footer.svelte"; import isEmail from "validator/es/lib/isEmail"; - import Toastify from "toastify-js"; + import toast from "svelte-french-toast"; // ------ let username = config.default_username || ""; let password = config.default_password || ""; @@ -20,11 +20,7 @@ OpenAPI.TOKEN = value.access_token; const jwtinfo = JSON.parse(atob(OpenAPI.TOKEN.split(".")[1])); store.login(value, jwtinfo); - Toastify({ - text: $_("welcome_wavinghand"), - duration: 500, - backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", - }).showToast(); + toast($_("welcome_wavinghand")); } } }); @@ -33,10 +29,7 @@ // prevent login button spamming if (last_loginclick_processed && is_blocked_by_autologin === false) { last_loginclick_processed = false; - Toastify({ - text: $_("login_is_checked"), - duration: 500, - }).showToast(); + toast.loading($_("login_is_checked")); let postdata = {}; if (isEmail(username)) { postdata = { @@ -56,31 +49,19 @@ const jwtinfo = JSON.parse(atob(OpenAPI.TOKEN.split(".")[1])); store.login(result.access_token, jwtinfo); location.replace("/"); - Toastify({ - text: $_("welcome_wavinghand"), - duration: 500, - backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", - }).showToast(); + toast.dismiss(); + toast($_("welcome_wavinghand")); }) .catch((err) => { - Toastify({ - text: $_("error_on_login"), - duration: 500, - backgroundColor: - "linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)", - }).showToast(); + toast.dismiss(); + toast.error($_("error_on_login")); }) .finally(() => { last_loginclick_processed = true; }); // last login was not processed yet } else { - Toastify({ - text: $_('please-wait-a-moment-your-login-is-still-being-processed'), - duration: 1500, - backgroundColor: - "linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)", - }).showToast(); + toast($_("please-wait-a-moment-your-login-is-still-being-processed")); } }; function handleKeydown(e) { @@ -91,34 +72,37 @@
{$_('application_name')}
-{$_('log_in_to_your_account')}
+{$_("application_name")}
+{$_("log_in_to_your_account")}