diff --git a/src/lib/components/toast-notification/ToastNotification.svelte b/src/lib/components/toast-notification/ToastNotification.svelte index 53496a7..37a0c3d 100644 --- a/src/lib/components/toast-notification/ToastNotification.svelte +++ b/src/lib/components/toast-notification/ToastNotification.svelte @@ -6,15 +6,17 @@ InfoIcon, WarningIcon, CloseIcon, - } from "./icons" + } from "./icons"; - +
-
- +
+ + {#if data.type === "success"} {:else if data.type === "warning"} @@ -25,8 +27,9 @@ {/if} - {data.description} + {data.description}
+
+ + {#if data.duration > 0} +
+ {/if}
+ /* Progress bar animation */ + @keyframes progress { + from { + width: 100%; + } + to { + width: 0; + } + } + diff --git a/src/lib/components/toast-notification/icons/error.svelte b/src/lib/components/toast-notification/icons/error.svelte index e173923..f54c39c 100644 --- a/src/lib/components/toast-notification/icons/error.svelte +++ b/src/lib/components/toast-notification/icons/error.svelte @@ -1,12 +1,12 @@ diff --git a/src/lib/components/toast-notification/icons/success.svelte b/src/lib/components/toast-notification/icons/success.svelte index 20955aa..fbd9a7d 100644 --- a/src/lib/components/toast-notification/icons/success.svelte +++ b/src/lib/components/toast-notification/icons/success.svelte @@ -1,12 +1,12 @@ diff --git a/src/pages/Auth/login-page/LoginPage.svelte b/src/pages/Auth/login-page/LoginPage.svelte index 664a2d4..cbbea46 100644 --- a/src/pages/Auth/login-page/LoginPage.svelte +++ b/src/pages/Auth/login-page/LoginPage.svelte @@ -190,7 +190,7 @@ type="password" autocomplete="off" id="exampleInputPassword1" - placeholder="Please enter your Password" + placeholder="Please enter your password" autocorrect="off" autocapitalize="none" bind:value={loginCredentials.password} @@ -210,13 +210,14 @@ validationErrors = await handleLoginValidation(loginCredentials); authenticationError = false; }} + maxlength="32" />
-
+
{#if verificationCodeError === true} - {errorMessage === 'Unauthorized Access' - ? 'You have entered the wrong code. Please check again.' - : errorMessage} + {errorMessage} {/if}
diff --git a/src/pages/Auth/update-password/update-password.ts b/src/pages/Auth/update-password/update-password.ts index 18b528c..b1a01ea 100644 --- a/src/pages/Auth/update-password/update-password.ts +++ b/src/pages/Auth/update-password/update-password.ts @@ -17,7 +17,7 @@ export const handleVerifyEmail = async ( navigate(`/reset/password/${verifyCodeCredential.email}/${response?.data}`); } else { isSuccessfulResponse.set(true); - if (response.message === "verificationCode should not be empty") { + if (response.message === "verificationCode should not be empty" || response.message === "verificationCode must be longer than or equal to 6 characters") { errorMessageText.set("Please enter the 6-digit verification code."); } diff --git a/src/pages/Auth/verify-email/VerifyEmail.svelte b/src/pages/Auth/verify-email/VerifyEmail.svelte index fbf0a27..ddf095a 100644 --- a/src/pages/Auth/verify-email/VerifyEmail.svelte +++ b/src/pages/Auth/verify-email/VerifyEmail.svelte @@ -124,6 +124,13 @@ notifications.success('Verification code sent successfully'); localStorage.setItem(`timer-verify-${id}`, new Date().getTime()); startTimer(); + verificationCode1 = ''; + verificationCode2 = ''; + verificationCode3 = ''; + verificationCode4 = ''; + verificationCode5 = ''; + verificationCode6 = ''; + onCodeInput(); } else { notifications.error(response.message); } @@ -469,9 +476,7 @@ {#if verificationCodeError === true} - {errorMessage === 'Unauthorized Access' - ? 'You have entered the wrong code. Please check again.' - : errorMessage} + {errorMessage} {/if} diff --git a/src/pages/Auth/verify-email/verify-email.ts b/src/pages/Auth/verify-email/verify-email.ts index f1e449e..e896a98 100644 --- a/src/pages/Auth/verify-email/verify-email.ts +++ b/src/pages/Auth/verify-email/verify-email.ts @@ -11,12 +11,12 @@ export const handleVerifyUserEmail = async (verifyCodeCredential: verifyPostbody errorMessageText.set(""); } else { isSuccessfulResponse.set(true); - if (response.message === 'verificationCode should not be empty') { + if (response.message === 'verificationCode should not be empty' || response.message === "verificationCode must be longer than or equal to 6 characters") { errorMessageText.set('Please enter the 6-digit verification code.'); } if (response.message === 'Wrong Code') { - errorMessageText.set('You have entered wrong code, Please check again.'); + errorMessageText.set('You have entered wrong code, please check your email.'); } } return response;