This commit is contained in:
Untone 2024-02-08 21:36:05 +03:00
parent 083d421cc5
commit 29d807343f
3 changed files with 18 additions and 6 deletions

View File

@ -440,6 +440,7 @@
"Write good articles, comment\nand it won't be so empty here": "Write good articles, comment\nand it won't be so empty here",
"Write message": "Write a message",
"Write to us": "Write to us",
"You can": "You can",
"Write your colleagues name or email": "Write your colleague's name or email",
"You can download multiple tracks at once in .mp3, .wav or .flac formats": "You can download multiple tracks at once in .mp3, .wav or .flac formats",
"You can now login using your new password": "Теперь вы можете входить с помощью нового пароля",

View File

@ -464,6 +464,7 @@
"Write message": "Написать сообщение",
"Write to us": "Напишите нам",
"Write your colleagues name or email": "Напишите имя или e-mail коллеги",
"You can": "Вы можете",
"You can download multiple tracks at once in .mp3, .wav or .flac formats": "Можно загрузить сразу несколько треков в форматах .mp3, .wav или .flac",
"You can now login using your new password": "Теперь вы можете входить с помощью нового пароля",
"You was successfully authorized": "Вы были успешно авторизованы",

View File

@ -15,6 +15,7 @@ import { PasswordField } from './PasswordField'
import { SocialProviders } from './SocialProviders'
import { email, setEmail } from './sharedLogic'
import { GenericResponse } from '@authorizerdev/authorizer-js'
import styles from './AuthModal.module.scss'
type EmailStatus = 'not verified' | 'verified' | 'registered' | ''
@ -110,6 +111,14 @@ export const RegisterForm = () => {
}
}
const handleResendLink = async (_ev) => {
const response: GenericResponse = await resendVerifyEmail({
email: email(),
identifier: 'basic_signup',
})
setIsSuccess(response?.message === 'Verification email has been sent. Please check your inbox')
}
const handleCheckEmailStatus = (status: EmailStatus | string) => {
switch (status) {
case 'not verified':
@ -118,10 +127,7 @@ export const RegisterForm = () => {
email: (
<>
{t('This email is not verified')},{' '}
<span
class="link"
onClick={() => resendVerifyEmail({ email: email(), identifier: 'basic_signup' })}
>
<span class="link" onClick={handleResendLink}>
{t('resend confirmation link')}
</span>
</>
@ -133,10 +139,14 @@ export const RegisterForm = () => {
setValidationErrors((prev) => ({
email: (
<>
{t('This email is verified')},{' '}
{t('This email is verified')}. {t('You can')}
<span class="link" onClick={() => changeSearchParams({ mode: 'login' })}>
{t('enter')}
</span>
{t('or')}{' '}
<span class="link" onClick={() => changeSearchParams({ mode: 'send-reset-link' })}>
{t('Set the new password').toLocaleLowerCase()}
</span>
</>
),
}))
@ -146,7 +156,7 @@ export const RegisterForm = () => {
...prev,
email: (
<>
{t('This email is registered')},{'. '}
{t('This email is registered')}. {t('You can')}{' '}
<span class="link" onClick={() => changeSearchParams({ mode: 'send-reset-link' })}>
{t('Set the new password').toLocaleLowerCase()}
</span>