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) setIsSubmitting(true)
try { try {
signSendLink({ email: email(), lang: locale() }) const result = await signSendLink({ email: email(), lang: locale() })
if (result.error) setSubmitError(result.error)
} catch (error) { } catch (error) {
setSubmitError(error.message) setSubmitError(error.message)
} finally { } finally {

View File

@ -40,12 +40,13 @@ export const LoginForm = () => {
setPassword(newPassword) setPassword(newPassword)
} }
const handleSendLinkAgainClick = (event: Event) => { const handleSendLinkAgainClick = async (event: Event) => {
event.preventDefault() event.preventDefault()
setIsEmailNotConfirmed(false) setIsEmailNotConfirmed(false)
setSubmitError('') setSubmitError('')
setIsLinkSent(true) 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) => { 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 }) => { 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 () => { export const renewSession = async () => {