mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-06 07:25:10 +08:00
fix: update reset password token when email code verify success (#18367)
This commit is contained in:
parent
7770a45253
commit
509733fbf0
@ -39,7 +39,11 @@ export default function CheckCode() {
|
|||||||
}
|
}
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
const ret = await verifyResetPasswordCode({ email, code, token })
|
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) }
|
catch (error) { console.error(error) }
|
||||||
finally {
|
finally {
|
||||||
|
@ -338,7 +338,7 @@ 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 }) =>
|
export const verifyResetPasswordCode = (body: { email: string; code: string; token: string }) =>
|
||||||
post<CommonResponse & { is_valid: boolean }>('/forgot-password/validity', { body })
|
post<CommonResponse & { is_valid: boolean; token: string }>('/forgot-password/validity', { body })
|
||||||
|
|
||||||
export const sendDeleteAccountCode = () =>
|
export const sendDeleteAccountCode = () =>
|
||||||
get<CommonResponse & { data: string }>('/account/delete/verify')
|
get<CommonResponse & { data: string }>('/account/delete/verify')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user