fix(api): propagate requestId for register and reset-password

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.
This commit is contained in:
zetaloop
2026-04-24 05:06:03 +08:00
parent e5fa8aa38b
commit 2ab075d173
5 changed files with 41 additions and 7 deletions
+9 -2
View File
@@ -1,8 +1,15 @@
import { httpJson } from "./http"
export async function sendForgotPasswordCode(email: string): Promise<void> {
await httpJson<unknown>("/api/v1/auth/forgot-password/send", {
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
}