reset endpoint + frontend reset and login pages add
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
|
||||
export async function requestPasswordReset(email: string): Promise<void> {
|
||||
const res = await fetch(`http://localhost:8000/protected/reset?${new URLSearchParams({ email })}`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
});
|
||||
if (!res.ok) {
|
||||
const body = await res.json().catch(() => null);
|
||||
throw new Error(typeof body?.detail === "string" ? body.detail : "Не удалось отправить запрос");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user