Login Translate
This commit is contained in:
parent
3bf7d70dea
commit
cd0b9d3b71
9 changed files with 266 additions and 68 deletions
|
|
@ -1416,6 +1416,66 @@
|
||||||
"en": "Enable self registration Description",
|
"en": "Enable self registration Description",
|
||||||
"tr": "Kendi kendine kaydı etkinleştir Açıklaması"
|
"tr": "Kendi kendine kaydı etkinleştir Açıklaması"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.WelcomeBack",
|
||||||
|
"en": "Welcome back!",
|
||||||
|
"tr": "Tekrar hoşgeldiniz!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.WelcomeBack.Message",
|
||||||
|
"en": "Please enter your credentials to sign in!",
|
||||||
|
"tr": "Giriş yapmak için lütfen kimlik bilgilerinizi girin!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.SignUp",
|
||||||
|
"en": "Sign up",
|
||||||
|
"tr": "Yeni Üye"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.SignUp.Message",
|
||||||
|
"en": "Don't have an account yet?",
|
||||||
|
"tr": "Henüz bir hesabınız yok mu?"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.EmailAddress",
|
||||||
|
"en": "Email Address",
|
||||||
|
"tr": "Email Adresi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.Password",
|
||||||
|
"en": "Password",
|
||||||
|
"tr": "Parola"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ConfirmPassword",
|
||||||
|
"en": "Confirm Password",
|
||||||
|
"tr": "Şifreyi Onayla"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.2FACode",
|
||||||
|
"en": "2FA Code",
|
||||||
|
"tr": "İki Faktör"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.RememberMe",
|
||||||
|
"en": "Remember Me",
|
||||||
|
"tr": "Beni Hatırla"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ForgotPassword",
|
||||||
|
"en": "Forgot password?",
|
||||||
|
"tr": "Şifremi Unuttum?"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "Abp.Account.TwoFactor",
|
"key": "Abp.Account.TwoFactor",
|
||||||
|
|
@ -1494,6 +1554,132 @@
|
||||||
"en": "Private Key Description",
|
"en": "Private Key Description",
|
||||||
"tr": "Özel Anahtarı Açıklaması"
|
"tr": "Özel Anahtarı Açıklaması"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ExtendLogin.Title",
|
||||||
|
"en": "Extension request received",
|
||||||
|
"tr": "Uzatma talebi alındı"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ExtendLogin.Description",
|
||||||
|
"en": "If your account is opened after your request is reviewed, you will also be sent an e-mail.",
|
||||||
|
"tr": "Talebiniz incelendikten sonra hesabınız açılırsa size ayrıca mail gönderilecektir."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.Backto",
|
||||||
|
"en": "Back to ",
|
||||||
|
"tr": "Geri dön "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.SignIn",
|
||||||
|
"en": "Sign in",
|
||||||
|
"tr": "Oturum Aç"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.Register",
|
||||||
|
"en": "New register",
|
||||||
|
"tr": "Yeni Üyelik"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ExtendLogin",
|
||||||
|
"en": "Extend My Login",
|
||||||
|
"tr": "Oturumu Uzat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ForgotPassword.Checkyouremail",
|
||||||
|
"en": "Check your email",
|
||||||
|
"tr": "E-postanızı kontrol edin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ForgotPassword.Checkyouremail.Message",
|
||||||
|
"en": "We have sent a password recovery instruction to your email",
|
||||||
|
"tr": "E-postanıza bir şifre kurtarma talimatı gönderdik"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ForgotPassword.Message",
|
||||||
|
"en": "Please enter your email address to receive a verification code",
|
||||||
|
"tr": "Doğrulama kodunu almak için lütfen e-posta adresinizi girin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ResetPassword.ResetDone",
|
||||||
|
"en": "Reset Done",
|
||||||
|
"tr": "Sıfırlama tamamlandı"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ResetPassword.ResetDone.Message",
|
||||||
|
"en": "Your password has been successfully reset",
|
||||||
|
"tr": "Şifreniz başarıyla sıfırlandı"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ResetPassword.SetNewPassword",
|
||||||
|
"en": "Set new password",
|
||||||
|
"tr": "Yeni şifre belirle"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ResetPassword.SetNewPassword.Message",
|
||||||
|
"en": "Your new password must different to previous password",
|
||||||
|
"tr": "Yeni şifreniz önceki şifrenizden farklı olmalıdır"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.ResetPassword.Continue",
|
||||||
|
"en": "Continue",
|
||||||
|
"tr": "Devam"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.SendConfirmationCode",
|
||||||
|
"en": "Confirm Email",
|
||||||
|
"tr": "E-posta Onayla"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.SendConfirmationCode.Message",
|
||||||
|
"en": "Please enter your email to receive new confirmation code",
|
||||||
|
"tr": "Yeni onay kodunu almak için lütfen e-postanızı girin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.VerifyConfirmationCode",
|
||||||
|
"en": "Request New Confirmation Code",
|
||||||
|
"tr": "Yeni Onay Kodu İsteyin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.Register.Title",
|
||||||
|
"en": "Sign Up",
|
||||||
|
"tr": "Üye Ol"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.Register.Message",
|
||||||
|
"en": "And let's get started with your free trial",
|
||||||
|
"tr": "Ve ücretsiz denemenize başlayalım"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.Register.AlreadyHaveAnAccount",
|
||||||
|
"en": "Already have an account? ",
|
||||||
|
"tr": "Zaten bir hesabınız var mı?"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "Abp.Account.Register.ResultMessage",
|
||||||
|
"en": "Success. Please confirm your account by clicking the link.",
|
||||||
|
"tr": "Başarılı. Lütfen bağlantıya tıklayarak hesabınızı onaylayın."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "Abp.Identity",
|
"key": "Abp.Identity",
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
|
||||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||||
}, {
|
}, {
|
||||||
"url": "index.html",
|
"url": "index.html",
|
||||||
"revision": "0.8b8tnlffsvo"
|
"revision": "0.952ffulqdco"
|
||||||
}], {});
|
}], {});
|
||||||
workbox.cleanupOutdatedCaches();
|
workbox.cleanupOutdatedCaches();
|
||||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import Input from '@/components/ui/Input'
|
||||||
import { ROUTES_ENUM } from '@/constants/route.constant'
|
import { ROUTES_ENUM } from '@/constants/route.constant'
|
||||||
import { sendExtendLoginRequest } from '@/proxy/account/account.service'
|
import { sendExtendLoginRequest } from '@/proxy/account/account.service'
|
||||||
import { store } from '@/store'
|
import { store } from '@/store'
|
||||||
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
|
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
|
||||||
import { Field, Form, Formik } from 'formik'
|
import { Field, Form, Formik } from 'formik'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
@ -18,7 +19,7 @@ type ExtendLoginFormSchema = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
email: Yup.string().required('Please enter your email'),
|
email: Yup.string().required(),
|
||||||
captchaResponse: Yup.string().required(),
|
captchaResponse: Yup.string().required(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -30,6 +31,7 @@ const ExtendLogin = () => {
|
||||||
const [emailSent, setEmailSent] = useState(false)
|
const [emailSent, setEmailSent] = useState(false)
|
||||||
|
|
||||||
const [message, setMessage] = useTimeOutMessage(10000)
|
const [message, setMessage] = useTimeOutMessage(10000)
|
||||||
|
const { translate } = useLocalization()
|
||||||
|
|
||||||
const onSendMail = async (
|
const onSendMail = async (
|
||||||
values: ExtendLoginFormSchema,
|
values: ExtendLoginFormSchema,
|
||||||
|
|
@ -51,17 +53,17 @@ const ExtendLogin = () => {
|
||||||
|
|
||||||
return emailSent ? (
|
return emailSent ? (
|
||||||
<>
|
<>
|
||||||
<h3 className="mb-1">Uzatma talebi alındı</h3>
|
<h3 className="mb-1">{ translate('::Abp.Account.ExtendLogin.Title')}</h3>
|
||||||
<p>Talebiniz incelendikten sonra hesabınız açılırsa size ayrıca mail gönderilecektir.</p>
|
<p>{ translate('::Abp.Account.ExtendLogin.Description')}</p>
|
||||||
<div className="mt-4 text-center">
|
<div className="mt-4 text-center">
|
||||||
<span>Back to </span>
|
<span>{translate('::Abp.Account.Backto')} </span>
|
||||||
<ActionLink to={signInUrl}>Sign in</ActionLink>
|
<ActionLink to={signInUrl}>{ translate('::Abp.Account.SignIn')}</ActionLink>
|
||||||
</div>{' '}
|
</div>{' '}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<h3 className="mb-1">Extend My Login</h3>
|
<h3 className="mb-1">{ translate('::Abp.Account.ExtendLogin')}</h3>
|
||||||
</div>
|
</div>
|
||||||
{message && (
|
{message && (
|
||||||
<Alert showIcon className="mb-4" type="danger">
|
<Alert showIcon className="mb-4" type="danger">
|
||||||
|
|
@ -91,7 +93,7 @@ const ExtendLogin = () => {
|
||||||
type="email"
|
type="email"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="email"
|
name="email"
|
||||||
placeholder="Email"
|
placeholder={translate('::Abp.Account.EmailAddress')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
@ -105,8 +107,8 @@ const ExtendLogin = () => {
|
||||||
{emailSent ? 'Resend Email' : 'Send Email'}
|
{emailSent ? 'Resend Email' : 'Send Email'}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="mt-4 text-center">
|
<div className="mt-4 text-center">
|
||||||
<span>Back to </span>
|
<span>{translate('::Abp.Account.Backto')} </span>
|
||||||
<ActionLink to={signInUrl}>Sign in</ActionLink>
|
<ActionLink to={signInUrl}>{ translate('::Abp.Account.SignIn')}</ActionLink>
|
||||||
</div>
|
</div>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import Input from '@/components/ui/Input'
|
||||||
import { ROUTES_ENUM } from '@/constants/route.constant'
|
import { ROUTES_ENUM } from '@/constants/route.constant'
|
||||||
import { sendPasswordResetCode } from '@/proxy/account/account.service'
|
import { sendPasswordResetCode } from '@/proxy/account/account.service'
|
||||||
import { store } from '@/store'
|
import { store } from '@/store'
|
||||||
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
|
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
|
||||||
import type { AxiosError } from 'axios'
|
import type { AxiosError } from 'axios'
|
||||||
import { Field, Form, Formik } from 'formik'
|
import { Field, Form, Formik } from 'formik'
|
||||||
|
|
@ -32,6 +33,7 @@ const ForgotPassword = () => {
|
||||||
const [emailSent, setEmailSent] = useState(false)
|
const [emailSent, setEmailSent] = useState(false)
|
||||||
|
|
||||||
const [message, setMessage] = useTimeOutMessage()
|
const [message, setMessage] = useTimeOutMessage()
|
||||||
|
const { translate } = useLocalization()
|
||||||
|
|
||||||
const onSendMail = async (
|
const onSendMail = async (
|
||||||
values: ForgotPasswordFormSchema,
|
values: ForgotPasswordFormSchema,
|
||||||
|
|
@ -62,13 +64,13 @@ const ForgotPassword = () => {
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
{emailSent ? (
|
{emailSent ? (
|
||||||
<>
|
<>
|
||||||
<h3 className="mb-1">Check your email</h3>
|
<h3 className="mb-1">{translate('::Abp.Account.ForgotPassword.Checkyouremail')}</h3>
|
||||||
<p>We have sent a password recovery instruction to your email</p>
|
<p>{translate('::Abp.Account.ForgotPassword.Checkyouremail.Message')}</p>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<h3 className="mb-1">Forgot Password</h3>
|
<h3 className="mb-1">{ translate('::Abp.Account.ForgotPassword')}</h3>
|
||||||
<p>Please enter your email address to receive a verification code</p>
|
<p>{ translate('::Abp.Account.ForgotPassword.Message')}</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -100,7 +102,7 @@ const ForgotPassword = () => {
|
||||||
type="email"
|
type="email"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="email"
|
name="email"
|
||||||
placeholder="Email"
|
placeholder={translate('::Abp.Account.EmailAddress')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
@ -114,8 +116,8 @@ const ForgotPassword = () => {
|
||||||
{emailSent ? 'Resend Email' : 'Send Email'}
|
{emailSent ? 'Resend Email' : 'Send Email'}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="mt-4 text-center">
|
<div className="mt-4 text-center">
|
||||||
<span>Back to </span>
|
<span>{translate('::Abp.Account.Backto')} </span>
|
||||||
<ActionLink to={signInUrl}>Sign in</ActionLink>
|
<ActionLink to={signInUrl}>{ translate('::Abp.Account.SignIn')}</ActionLink>
|
||||||
</div>
|
</div>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -202,13 +202,13 @@ const Login = () => {
|
||||||
transition={{ duration: 0.5, origin: 1 }}
|
transition={{ duration: 0.5, origin: 1 }}
|
||||||
>
|
>
|
||||||
<div className="mb-8">
|
<div className="mb-8">
|
||||||
<h3 className="mb-1">Welcome back!</h3>
|
<h3 className="mb-1">{translate('::Abp.Account.WelcomeBack')}</h3>
|
||||||
<p>Please enter your credentials to sign in!</p>
|
<p>{translate('::Abp.Account.WelcomeBack.Message')}</p>
|
||||||
</div>
|
</div>
|
||||||
{isMultiTenant && (
|
{isMultiTenant && (
|
||||||
<>
|
<>
|
||||||
<label className="form-label mb-2" style={tenantStyle}>
|
<label className="form-label mb-2" style={tenantStyle}>
|
||||||
Company
|
{ translate('::Sirket')}
|
||||||
</label>
|
</label>
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<Input
|
<Input
|
||||||
|
|
@ -238,7 +238,7 @@ const Login = () => {
|
||||||
<FormContainer>
|
<FormContainer>
|
||||||
{!twoFactor && (
|
{!twoFactor && (
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Email"
|
label={translate('::Abp.Account.EmailAddress')}
|
||||||
invalid={errors.userName && touched.userName}
|
invalid={errors.userName && touched.userName}
|
||||||
errorMessage={errors.userName}
|
errorMessage={errors.userName}
|
||||||
>
|
>
|
||||||
|
|
@ -246,35 +246,35 @@ const Login = () => {
|
||||||
type="text"
|
type="text"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="userName"
|
name="userName"
|
||||||
placeholder="Email"
|
placeholder={translate('::Abp.Account.EmailAddress')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
{!twoFactor && (
|
{!twoFactor && (
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Password"
|
label={translate('::Abp.Account.Password')}
|
||||||
invalid={errors.password && touched.password}
|
invalid={errors.password && touched.password}
|
||||||
errorMessage={errors.password}
|
errorMessage={errors.password}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="password"
|
name="password"
|
||||||
placeholder="Password"
|
placeholder={translate('::Abp.Account.Password')}
|
||||||
component={PasswordInput}
|
component={PasswordInput}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
{twoFactor && (
|
{twoFactor && (
|
||||||
<FormItem
|
<FormItem
|
||||||
label="2FA Code"
|
label={translate('::Abp.Account.2FACode')}
|
||||||
invalid={errors.twoFactorCode && touched.twoFactorCode}
|
invalid={errors.twoFactorCode && touched.twoFactorCode}
|
||||||
errorMessage={errors.twoFactorCode}
|
errorMessage={errors.twoFactorCode}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="twoFactorCode"
|
name="twoFactorCode"
|
||||||
placeholder="2FA Code"
|
placeholder={translate('::Abp.Account.2FACode')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
@ -282,9 +282,9 @@ const Login = () => {
|
||||||
|
|
||||||
<div className="flex justify-between mb-6">
|
<div className="flex justify-between mb-6">
|
||||||
<Field className="mb-0" name="rememberMe" component={Checkbox}>
|
<Field className="mb-0" name="rememberMe" component={Checkbox}>
|
||||||
Remember Me
|
{translate('::Abp.Account.RememberMe')}
|
||||||
</Field>
|
</Field>
|
||||||
<ActionLink to={ROUTES_ENUM.account.forgotPassword}>Forgot Password?</ActionLink>
|
<ActionLink to={ROUTES_ENUM.account.forgotPassword}>{translate('::Abp.Account.ForgotPassword')}</ActionLink>
|
||||||
</div>
|
</div>
|
||||||
{showCaptcha && (
|
{showCaptcha && (
|
||||||
<Captcha
|
<Captcha
|
||||||
|
|
@ -310,8 +310,8 @@ const Login = () => {
|
||||||
{isSubmitting ? 'Signing in...' : 'Sign In'}
|
{isSubmitting ? 'Signing in...' : 'Sign In'}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="mt-4 text-center">
|
<div className="mt-4 text-center">
|
||||||
<span>Dont have an account yet? </span>
|
<span>{translate('::Abp.Account.SignUp.Message')} </span>
|
||||||
<ActionLink to={ROUTES_ENUM.account.register}>Sign up</ActionLink>
|
<ActionLink to={ROUTES_ENUM.account.register}>{translate('::Abp.Account.Register')}</ActionLink>
|
||||||
</div>
|
</div>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import Captcha from '@/components/shared/Captcha'
|
||||||
import { Field, Form, Formik } from 'formik'
|
import { Field, Form, Formik } from 'formik'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import * as Yup from 'yup'
|
import * as Yup from 'yup'
|
||||||
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
|
|
||||||
type SignUpFormSchema = {
|
type SignUpFormSchema = {
|
||||||
password: string
|
password: string
|
||||||
|
|
@ -21,11 +22,11 @@ type SignUpFormSchema = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
email: Yup.string().email('Invalid email').required('Please enter your email'),
|
email: Yup.string().email().required(),
|
||||||
password: Yup.string().required('Please enter your password'),
|
password: Yup.string().required(),
|
||||||
confirmPassword: Yup.string().oneOf([Yup.ref('password')], 'Your passwords do not match'),
|
confirmPassword: Yup.string().oneOf([Yup.ref('password')], 'Your passwords do not match'),
|
||||||
name: Yup.string().required('Name is required'),
|
name: Yup.string().required(),
|
||||||
surname: Yup.string().required('Surname is required'),
|
surname: Yup.string().required(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const Register = () => {
|
const Register = () => {
|
||||||
|
|
@ -33,6 +34,7 @@ const Register = () => {
|
||||||
const signInUrl = ROUTES_ENUM.account.login
|
const signInUrl = ROUTES_ENUM.account.login
|
||||||
|
|
||||||
const { signUp } = useAuth()
|
const { signUp } = useAuth()
|
||||||
|
const { translate } = useLocalization()
|
||||||
|
|
||||||
const [message, setMessage] = useState('')
|
const [message, setMessage] = useState('')
|
||||||
const [error, setError] = useTimeOutMessage(10000)
|
const [error, setError] = useTimeOutMessage(10000)
|
||||||
|
|
@ -48,7 +50,7 @@ const Register = () => {
|
||||||
setError(result.message)
|
setError(result.message)
|
||||||
setMessage('')
|
setMessage('')
|
||||||
} else {
|
} else {
|
||||||
setMessage('Success. Please confirm your account by clicking the link.')
|
setMessage(translate('::Abp.Account.Register.ResultMessage'))
|
||||||
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
|
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
|
||||||
setError('')
|
setError('')
|
||||||
}
|
}
|
||||||
|
|
@ -59,8 +61,8 @@ const Register = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="mb-8">
|
<div className="mb-8">
|
||||||
<h3 className="mb-1">Sign Up</h3>
|
<h3 className="mb-1">{translate('::Abp.Account.Register.Title')}</h3>
|
||||||
<p>And lets get started with your free trial</p>
|
<p>{translate('::Abp.Account.Register.Message')}</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{message && (
|
{message && (
|
||||||
|
|
@ -95,7 +97,7 @@ const Register = () => {
|
||||||
<Form>
|
<Form>
|
||||||
<FormContainer>
|
<FormContainer>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Email"
|
label={translate('::Abp.Account.EmailAddress')}
|
||||||
invalid={errors.email && touched.email}
|
invalid={errors.email && touched.email}
|
||||||
errorMessage={errors.email}
|
errorMessage={errors.email}
|
||||||
>
|
>
|
||||||
|
|
@ -103,36 +105,36 @@ const Register = () => {
|
||||||
type="email"
|
type="email"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="email"
|
name="email"
|
||||||
placeholder="Email"
|
placeholder={translate('::Abp.Account.EmailAddress')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Password"
|
label={translate('::Abp.Account.Password')}
|
||||||
invalid={errors.password && touched.password}
|
invalid={errors.password && touched.password}
|
||||||
errorMessage={errors.password}
|
errorMessage={errors.password}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="password"
|
name="password"
|
||||||
placeholder="Password"
|
placeholder={translate('::Abp.Account.Password')}
|
||||||
component={PasswordInput}
|
component={PasswordInput}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Confirm Password"
|
label={translate('::Abp.Account.ConfirmPassword')}
|
||||||
invalid={errors.confirmPassword && touched.confirmPassword}
|
invalid={errors.confirmPassword && touched.confirmPassword}
|
||||||
errorMessage={errors.confirmPassword}
|
errorMessage={errors.confirmPassword}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="confirmPassword"
|
name="confirmPassword"
|
||||||
placeholder="Confirm Password"
|
placeholder={translate('::Abp.Account.ConfirmPassword')}
|
||||||
component={PasswordInput}
|
component={PasswordInput}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Name"
|
label={translate('::Abp.Identity.User.UserInformation.Name')}
|
||||||
invalid={errors.name && touched.name}
|
invalid={errors.name && touched.name}
|
||||||
errorMessage={errors.name}
|
errorMessage={errors.name}
|
||||||
>
|
>
|
||||||
|
|
@ -140,12 +142,12 @@ const Register = () => {
|
||||||
type="name"
|
type="name"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="name"
|
name="name"
|
||||||
placeholder="Name"
|
placeholder={translate('::Abp.Identity.User.UserInformation.Name')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Surname"
|
label={translate('::Abp.Identity.User.UserInformation.Surname')}
|
||||||
invalid={errors.surname && touched.surname}
|
invalid={errors.surname && touched.surname}
|
||||||
errorMessage={errors.surname}
|
errorMessage={errors.surname}
|
||||||
>
|
>
|
||||||
|
|
@ -153,7 +155,7 @@ const Register = () => {
|
||||||
type="surname"
|
type="surname"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="surname"
|
name="surname"
|
||||||
placeholder="Surname"
|
placeholder={translate('::Abp.Identity.User.UserInformation.Surname')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
@ -166,8 +168,8 @@ const Register = () => {
|
||||||
{isSubmitting ? 'Creating Account...' : 'Sign Up'}
|
{isSubmitting ? 'Creating Account...' : 'Sign Up'}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="mt-4 text-center">
|
<div className="mt-4 text-center">
|
||||||
<span>Already have an account? </span>
|
<span>{translate('::Abp.Account.Register.AlreadyHaveAnAccount')} </span>
|
||||||
<ActionLink to={signInUrl}>Sign in</ActionLink>
|
<ActionLink to={signInUrl}>{translate('::Abp.Account.SignIn')}</ActionLink>
|
||||||
</div>
|
</div>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import Button from '@/components/ui/Button'
|
||||||
import { FormContainer, FormItem } from '@/components/ui/Form'
|
import { FormContainer, FormItem } from '@/components/ui/Form'
|
||||||
import { ROUTES_ENUM } from '@/constants/route.constant'
|
import { ROUTES_ENUM } from '@/constants/route.constant'
|
||||||
import { resetPassword } from '@/proxy/account/account.service'
|
import { resetPassword } from '@/proxy/account/account.service'
|
||||||
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
|
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
|
||||||
import type { AxiosError } from 'axios'
|
import type { AxiosError } from 'axios'
|
||||||
import { Field, Form, Formik } from 'formik'
|
import { Field, Form, Formik } from 'formik'
|
||||||
|
|
@ -29,6 +30,7 @@ const ResetPassword = () => {
|
||||||
const [searchParams] = useSearchParams()
|
const [searchParams] = useSearchParams()
|
||||||
const userId = searchParams.get('userId')
|
const userId = searchParams.get('userId')
|
||||||
const resetToken = searchParams.get('resetToken')
|
const resetToken = searchParams.get('resetToken')
|
||||||
|
const { translate } = useLocalization()
|
||||||
|
|
||||||
// bu olmadan da oluyor sanırım
|
// bu olmadan da oluyor sanırım
|
||||||
// const result = useQuery({
|
// const result = useQuery({
|
||||||
|
|
@ -78,13 +80,13 @@ const ResetPassword = () => {
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
{resetComplete ? (
|
{resetComplete ? (
|
||||||
<>
|
<>
|
||||||
<h3 className="mb-1">Reset done</h3>
|
<h3 className="mb-1">{translate('::Abp.Account.ResetPassword.ResetDone')}</h3>
|
||||||
<p>Your password has been successfully reset</p>
|
<p>{translate('::Abp.Account.ResetPassword.ResetDone.Message')}</p>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<h3 className="mb-1">Set new password</h3>
|
<h3 className="mb-1">{translate('::Abp.Account.ResetPassword.SetNewPassword')}</h3>
|
||||||
<p>Your new password must different to previos password</p>
|
<p>{translate('::Abp.Account.ResetPassword.SetNewPassword.Message')}</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -113,26 +115,26 @@ const ResetPassword = () => {
|
||||||
{!resetComplete ? (
|
{!resetComplete ? (
|
||||||
<>
|
<>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Password"
|
label={translate('::Abp.Account.Password')}
|
||||||
invalid={errors.password && touched.password}
|
invalid={errors.password && touched.password}
|
||||||
errorMessage={errors.password}
|
errorMessage={errors.password}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="password"
|
name="password"
|
||||||
placeholder="Password"
|
placeholder={translate('::Abp.Account.Password')}
|
||||||
component={PasswordInput}
|
component={PasswordInput}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Confirm Password"
|
label={translate('::Abp.Identity.Password.ConfirmPassword')}
|
||||||
invalid={errors.confirmPassword && touched.confirmPassword}
|
invalid={errors.confirmPassword && touched.confirmPassword}
|
||||||
errorMessage={errors.confirmPassword}
|
errorMessage={errors.confirmPassword}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="confirmPassword"
|
name="confirmPassword"
|
||||||
placeholder="Confirm Password"
|
placeholder={translate('::Abp.Identity.Password.ConfirmPassword')}
|
||||||
component={PasswordInput}
|
component={PasswordInput}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
@ -142,13 +144,13 @@ const ResetPassword = () => {
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Button block variant="solid" type="button" onClick={onContinue}>
|
<Button block variant="solid" type="button" onClick={onContinue}>
|
||||||
Continue
|
{translate('::Abp.Account.ResetPassword.Continue')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="mt-4 text-center">
|
<div className="mt-4 text-center">
|
||||||
<span>Back to </span>
|
<span>{translate('::Abp.Account.Backto')} </span>
|
||||||
<ActionLink to={signInUrl}>Sign in</ActionLink>
|
<ActionLink to={signInUrl}>{translate('::Abp.Account.SignIn')}</ActionLink>
|
||||||
</div>
|
</div>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { ActionLink } from '@/components/shared'
|
||||||
import { ROUTES_ENUM } from '@/constants/route.constant'
|
import { ROUTES_ENUM } from '@/constants/route.constant'
|
||||||
import { store } from '@/store'
|
import { store } from '@/store'
|
||||||
import Captcha from '@/components/shared/Captcha'
|
import Captcha from '@/components/shared/Captcha'
|
||||||
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
|
|
||||||
type FormSchema = {
|
type FormSchema = {
|
||||||
email: string
|
email: string
|
||||||
|
|
@ -13,12 +14,13 @@ type FormSchema = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
email: Yup.string().required('Please enter your user email'),
|
email: Yup.string().required(),
|
||||||
captchaResponse: Yup.string().required(),
|
captchaResponse: Yup.string().required(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const SendConfirmationCode = () => {
|
const SendConfirmationCode = () => {
|
||||||
const { userName } = store.getState().auth.user
|
const { userName } = store.getState().auth.user
|
||||||
|
const { translate } = useLocalization()
|
||||||
|
|
||||||
const { message, error, sendConfirmationCode } = useAccount()
|
const { message, error, sendConfirmationCode } = useAccount()
|
||||||
|
|
||||||
|
|
@ -33,8 +35,8 @@ const SendConfirmationCode = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="mb-8">
|
<div className="mb-8">
|
||||||
<h3 className="mb-1">Confirm Email</h3>
|
<h3 className="mb-1">{translate('::Abp.Account.SendConfirmationCode')}</h3>
|
||||||
<p>Please enter your email to receive new confirmation code</p>
|
<p>{translate('::Abp.Account.SendConfirmationCode.Message')}</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{message && (
|
{message && (
|
||||||
|
|
@ -61,7 +63,7 @@ const SendConfirmationCode = () => {
|
||||||
<Form>
|
<Form>
|
||||||
<FormContainer>
|
<FormContainer>
|
||||||
<FormItem
|
<FormItem
|
||||||
label="Email"
|
label={translate('::Abp.Account.EmailAddress')}
|
||||||
invalid={errors.email && touched.email}
|
invalid={errors.email && touched.email}
|
||||||
errorMessage={errors.email}
|
errorMessage={errors.email}
|
||||||
>
|
>
|
||||||
|
|
@ -69,7 +71,7 @@ const SendConfirmationCode = () => {
|
||||||
type="email"
|
type="email"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="email"
|
name="email"
|
||||||
placeholder="Email"
|
placeholder={translate('::Abp.Account.EmailAddress')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
@ -82,8 +84,8 @@ const SendConfirmationCode = () => {
|
||||||
{isSubmitting ? 'Sending code...' : 'Send Code'}
|
{isSubmitting ? 'Sending code...' : 'Send Code'}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="mt-4 text-center">
|
<div className="mt-4 text-center">
|
||||||
<span>Back to </span>
|
<span>{translate('::Abp.Account.Backto')} </span>
|
||||||
<ActionLink to={ROUTES_ENUM.account.login}>Login</ActionLink>
|
<ActionLink to={ROUTES_ENUM.account.login}>{translate('::Abp.Account.SignIn')}</ActionLink>
|
||||||
</div>
|
</div>
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,13 @@ import { useQuery } from '@tanstack/react-query'
|
||||||
import { Alert, Button } from '@/components/ui'
|
import { Alert, Button } from '@/components/ui'
|
||||||
import { useNavigate, useParams } from 'react-router-dom'
|
import { useNavigate, useParams } from 'react-router-dom'
|
||||||
import useAccount from '@/utils/hooks/useAccount'
|
import useAccount from '@/utils/hooks/useAccount'
|
||||||
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
|
|
||||||
const VerifyConfirmationCode = () => {
|
const VerifyConfirmationCode = () => {
|
||||||
const { userId, token } = useParams()
|
const { userId, token } = useParams()
|
||||||
const { message, error, verifyConfirmationCode } = useAccount()
|
const { message, error, verifyConfirmationCode } = useAccount()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
const { translate } = useLocalization()
|
||||||
|
|
||||||
useQuery({
|
useQuery({
|
||||||
queryKey: ['verifyConfirmationCode', userId, token],
|
queryKey: ['verifyConfirmationCode', userId, token],
|
||||||
|
|
@ -29,7 +31,7 @@ const VerifyConfirmationCode = () => {
|
||||||
{error}
|
{error}
|
||||||
</Alert>
|
</Alert>
|
||||||
<Button block variant="solid" onClick={() => navigate('/account/confirm')}>
|
<Button block variant="solid" onClick={() => navigate('/account/confirm')}>
|
||||||
Request New Confirmation Code
|
{translate('::Abp.Account.VerifyConfirmationCode')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue