mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
Merge branch 'feat/auth-methods' into deploy/dev
This commit is contained in:
commit
2a99fae934
|
@ -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'),
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -45,6 +45,7 @@ type LoginSuccess = {
|
|||
type LoginFail = {
|
||||
result: 'fail'
|
||||
data: string
|
||||
code: string
|
||||
message: string
|
||||
}
|
||||
type LoginResponse = LoginSuccess | LoginFail
|
||||
|
@ -333,7 +334,7 @@ export const emailLoginWithCode = (data: { email: string;code: string;token: str
|
|||
post<LoginResponse>('/email-code-login/validity', { body: data })
|
||||
|
||||
export const sendResetPasswordCode = (email: string, language = 'en-US') =>
|
||||
post<CommonResponse & { data: string;message?: string }>('/forgot-password', { body: { email, language } })
|
||||
post<CommonResponse & { data: string;message?: string ;code?: string }>('/forgot-password', { body: { email, language } })
|
||||
|
||||
export const verifyResetPasswordCode = (body: { email: string;code: string;token: string }) =>
|
||||
post<CommonResponse & { is_valid: boolean }>('/forgot-password/validity', { body })
|
||||
|
|
Loading…
Reference in New Issue
Block a user