19.05.2026 okkk
This commit is contained in:
@@ -69,14 +69,20 @@ export async function uploadAvatar(payload: UploadAvatarPayload): Promise<MeResp
|
||||
return data
|
||||
}
|
||||
|
||||
export async function passwordResetStart(): Promise<void> {
|
||||
export interface PasswordResetStartPayload {
|
||||
email: string
|
||||
}
|
||||
|
||||
export async function passwordResetStart(payload: PasswordResetStartPayload): Promise<void> {
|
||||
const csrf = await getCsrfToken()
|
||||
const res = await fetch(`${USERS_API_URL}/me/settings/password/start`, {
|
||||
const res = await fetch(`${USERS_API_URL}/me/settings/password/forgot/start`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-Token': csrf,
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
if (!res.ok) {
|
||||
const data = await res.json().catch(() => ({}))
|
||||
@@ -92,7 +98,7 @@ export interface PasswordResetCompletePayload {
|
||||
|
||||
export async function passwordResetComplete(payload: PasswordResetCompletePayload): Promise<void> {
|
||||
const csrf = await getCsrfToken()
|
||||
const res = await fetch(`${USERS_API_URL}/me/settings/password/complete`, {
|
||||
const res = await fetch(`${USERS_API_URL}/me/settings/password/forgot/complete`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user