diff --git a/web/app/reset-password/page.tsx b/web/app/reset-password/page.tsx index d3be307c73..65f1db3fb5 100644 --- a/web/app/reset-password/page.tsx +++ b/web/app/reset-password/page.tsx @@ -44,7 +44,7 @@ export default function CheckCode() { params.set('email', encodeURIComponent(email)) router.push(`/reset-password/check-code?${params.toString()}`) } - else if (res.message === 'account_not_found') { + else if (res.code === 'account_not_found') { Toast.notify({ type: 'error', message: t('login.error.registrationNotAllowed'), diff --git a/web/app/signin/components/mail-and-password-auth.tsx b/web/app/signin/components/mail-and-password-auth.tsx index e115ed6a42..210c877bb7 100644 --- a/web/app/signin/components/mail-and-password-auth.tsx +++ b/web/app/signin/components/mail-and-password-auth.tsx @@ -75,7 +75,7 @@ export default function MailAndPasswordAuth({ isInvite, allowRegistration }: Mai router.replace('/apps') } } - else if (res.message === 'account_not_found') { + else if (res.code === 'account_not_found') { if (allowRegistration) { const params = new URLSearchParams() params.append('email', encodeURIComponent(email)) diff --git a/web/service/common.ts b/web/service/common.ts index 70d9844d3a..1bf9e915ad 100644 --- a/web/service/common.ts +++ b/web/service/common.ts @@ -45,6 +45,7 @@ type LoginSuccess = { type LoginFail = { result: 'fail' data: string + code: string message: string } type LoginResponse = LoginSuccess | LoginFail @@ -330,7 +331,7 @@ export const emailLoginWithCode = (data: { email: string;code: string;token: str post('/email-code-login/validity', { body: data }) export const sendResetPasswordCode = (email: string, language = 'en-US') => - post('/forgot-password', { body: { email, language } }) + post('/forgot-password', { body: { email, language } }) export const verifyResetPasswordCode = (body: { email: string;code: string;token: string }) => post('/forgot-password/validity', { body })