Merge branch 'auth' into testing

This commit is contained in:
tonyrewin 2022-11-02 10:28:23 +03:00
commit 1574fc083b
3 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,8 @@ export const ForgotPasswordForm = () => {
setIsSubmitting(true)
try {
signSendLink({ email: email(), lang: locale() })
const result = await signSendLink({ email: email(), lang: locale() })
if (result.error) setSubmitError(result.error)
} catch (error) {
setSubmitError(error.message)
} finally {

View File

@ -40,12 +40,13 @@ export const LoginForm = () => {
setPassword(newPassword)
}
const handleSendLinkAgainClick = (event: Event) => {
const handleSendLinkAgainClick = async (event: Event) => {
event.preventDefault()
setIsEmailNotConfirmed(false)
setSubmitError('')
setIsLinkSent(true)
signSendLink({ email: email(), lang: locale() })
const result = await signSendLink({ email: email(), lang: locale() })
if (result.error) setSubmitError(result.error)
}
const handleSubmit = async (event: Event) => {

View File

@ -54,7 +54,7 @@ export const register = async ({
}
export const signSendLink = async ({ email, lang }: { email: string; lang: string }) => {
await apiClient.authSendLink({ email, lang })
return await apiClient.authSendLink({ email, lang })
}
export const renewSession = async () => {