mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 00:45:53 +08:00
fix: update reset password token when email code verify success (#18362)
This commit is contained in:
parent
99a9def623
commit
161ff432f1
@ -39,7 +39,11 @@ export default function CheckCode() {
|
||||
}
|
||||
setIsLoading(true)
|
||||
const ret = await verifyResetPasswordCode({ email, code, token })
|
||||
ret.is_valid && router.push(`/reset-password/set-password?${searchParams.toString()}`)
|
||||
if (ret.is_valid) {
|
||||
const params = new URLSearchParams(searchParams)
|
||||
params.set('token', encodeURIComponent(ret.token))
|
||||
router.push(`/reset-password/set-password?${params.toString()}`)
|
||||
}
|
||||
}
|
||||
catch (error) { console.error(error) }
|
||||
finally {
|
||||
|
@ -40,7 +40,7 @@ import type { SystemFeatures } from '@/types/feature'
|
||||
|
||||
type LoginSuccess = {
|
||||
result: 'success'
|
||||
data: { access_token: string;refresh_token: string }
|
||||
data: { access_token: string; refresh_token: string }
|
||||
}
|
||||
type LoginFail = {
|
||||
result: 'fail'
|
||||
@ -331,20 +331,20 @@ export const uploadRemoteFileInfo = (url: string, isPublic?: boolean) => {
|
||||
export const sendEMailLoginCode = (email: string, language = 'en-US') =>
|
||||
post<CommonResponse & { data: string }>('/email-code-login', { body: { email, language } })
|
||||
|
||||
export const emailLoginWithCode = (data: { email: string;code: string;token: string }) =>
|
||||
export const emailLoginWithCode = (data: { email: string; code: string; token: string }) =>
|
||||
post<LoginResponse>('/email-code-login/validity', { body: data })
|
||||
|
||||
export const sendResetPasswordCode = (email: string, language = 'en-US') =>
|
||||
post<CommonResponse & { data: string;message?: string ;code?: 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 })
|
||||
export const verifyResetPasswordCode = (body: { email: string; code: string; token: string }) =>
|
||||
post<CommonResponse & { is_valid: boolean; token: string }>('/forgot-password/validity', { body })
|
||||
|
||||
export const sendDeleteAccountCode = () =>
|
||||
get<CommonResponse & { data: string }>('/account/delete/verify')
|
||||
|
||||
export const verifyDeleteAccountCode = (body: { code: string;token: string }) =>
|
||||
export const verifyDeleteAccountCode = (body: { code: string; token: string }) =>
|
||||
post<CommonResponse & { is_valid: boolean }>('/account/delete', { body })
|
||||
|
||||
export const submitDeleteAccountFeedback = (body: { feedback: string;email: string }) =>
|
||||
export const submitDeleteAccountFeedback = (body: { feedback: string; email: string }) =>
|
||||
post<CommonResponse>('/account/delete/feedback', { body })
|
||||
|
Loading…
x
Reference in New Issue
Block a user