2ab075d173
Backend requires X-Request-Id header from the verification code send response. Wire requestId through email/auth-extra API returns, register and forgot-password pages, and auth API request headers.
16 lines
379 B
TypeScript
16 lines
379 B
TypeScript
import { httpJson } from "./http"
|
|
|
|
interface SendVerificationCodeResp {
|
|
requestId: string
|
|
expireInSec: number
|
|
message: string
|
|
}
|
|
|
|
export async function sendForgotPasswordCode(email: string): Promise<string> {
|
|
const res = await httpJson<SendVerificationCodeResp>("/api/v1/auth/forgot-password/send", {
|
|
method: "POST",
|
|
json: { email },
|
|
})
|
|
return res.requestId
|
|
}
|