feat: signup confirm password
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
let name = '';
|
||||
let email = '';
|
||||
let password = '';
|
||||
let confirmPassword = '';
|
||||
|
||||
let ldapUsername = '';
|
||||
|
||||
@@ -63,6 +64,11 @@
|
||||
};
|
||||
|
||||
const signUpHandler = async () => {
|
||||
if (password !== confirmPassword) {
|
||||
toast.error($i18n.t('Passwords do not match.'));
|
||||
return;
|
||||
}
|
||||
|
||||
const sessionUser = await userSignUp(name, email, password, generateInitialsImage(name)).catch(
|
||||
(error) => {
|
||||
toast.error(`${error}`);
|
||||
@@ -178,8 +184,6 @@
|
||||
<div class="w-full absolute top-0 left-0 right-0 h-8 drag-region" />
|
||||
|
||||
{#if loaded}
|
||||
|
||||
|
||||
<div
|
||||
class="fixed bg-transparent min-h-screen w-full flex justify-center font-primary z-50 text-black dark:text-white"
|
||||
id="auth-container"
|
||||
@@ -300,6 +304,26 @@
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
{#if mode === 'signup' && $config?.features?.enable_signup_password_confirmation}
|
||||
<div class="mt-2">
|
||||
<label
|
||||
for="confirm-password"
|
||||
class="text-sm font-medium text-left mb-1 block"
|
||||
>{$i18n.t('Confirm Password')}</label
|
||||
>
|
||||
<input
|
||||
bind:value={confirmPassword}
|
||||
type="password"
|
||||
id="confirm-password"
|
||||
class="my-0.5 w-full text-sm outline-hidden bg-transparent"
|
||||
placeholder={$i18n.t('Confirm Your Password')}
|
||||
autocomplete="new-password"
|
||||
name="confirm-password"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="mt-5">
|
||||
|
||||
Reference in New Issue
Block a user