diff --git a/src/routes/(authentication)/login/+page.svelte b/src/routes/(authentication)/login/+page.svelte index 0ae00f55..bd9289a9 100644 --- a/src/routes/(authentication)/login/+page.svelte +++ b/src/routes/(authentication)/login/+page.svelte @@ -13,15 +13,15 @@ Alert } from '@sveltestrap/sveltestrap'; import Headtitle from '$lib/common/HeadTitle.svelte'; - import { getToken } from '$lib/services/auth-service.js' + import { getToken } from '$lib/services/auth-service.js'; import { goto } from '$app/navigation'; - import { - PUBLIC_LOGO_URL, + import { + PUBLIC_LOGO_URL, PUBLIC_LOGIN_IMAGE, - PUBLIC_BRAND_NAME, - PUBLIC_ADMIN_USERNAME, + PUBLIC_BRAND_NAME, + PUBLIC_ADMIN_USERNAME, PUBLIC_ADMIN_PASSWORD, - PUBLIC_COMPANY_NAME + PUBLIC_COMPANY_NAME } from '$env/static/public'; let username = PUBLIC_ADMIN_USERNAME; @@ -29,15 +29,30 @@ let isOpen = false; let msg = ''; let status = ''; + let isSubmitting = false; async function onSubmit(e) { + isSubmitting = true; e.preventDefault(); - await getToken(username, password, () => { isOpen = true; msg = 'Authentication success'; status = 'success'; goto('/page/dashboard'); + isSubmitting = false; }); + isSubmitting = false; + } + function onPasswordToggle() { + var x = document.getElementById('user-password'); + if (x.type === 'password') { + x.type = 'text'; + var icon = document.getElementById('password-eye-icon'); + icon.className = 'mdi mdi-eye-off-outline'; + } else { + x.type = 'password'; + var icon = document.getElementById('password-eye-icon'); + icon.className = 'mdi mdi-eye-outline'; + } } @@ -103,8 +118,8 @@ aria-describedby="password-addon" bind:value={password} /> - onPasswordToggle()} + > @@ -115,8 +130,8 @@
- © {new Date().getFullYear()} {PUBLIC_COMPANY_NAME}. Crafted with + © {new Date().getFullYear()} + {PUBLIC_COMPANY_NAME}. Crafted with by open source community