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:
+9
-2
@@ -1,11 +1,18 @@
|
||||
import { httpJson } from "./http"
|
||||
|
||||
interface SendVerificationCodeResp {
|
||||
requestId: string
|
||||
expireInSec: number
|
||||
message: string
|
||||
}
|
||||
|
||||
export async function sendEmailVerificationCode(input: {
|
||||
email: string
|
||||
scene: string
|
||||
}): Promise<void> {
|
||||
await httpJson<unknown>("/api/v1/email/verification-code/send", {
|
||||
}): Promise<string> {
|
||||
const res = await httpJson<SendVerificationCodeResp>("/api/v1/email/verification-code/send", {
|
||||
method: "POST",
|
||||
json: { email: input.email, scene: input.scene },
|
||||
})
|
||||
return res.requestId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user