19.05.2026 okkk

This commit is contained in:
2026-05-19 15:50:47 +03:00
parent 36196a882f
commit 370141c83b
5 changed files with 86 additions and 37 deletions

View File

@@ -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: {