From cee3bd371935a623213aa7e5b1ca39b049d9d8ec Mon Sep 17 00:00:00 2001 From: zetaloop Date: Sat, 28 Feb 2026 15:39:48 +0800 Subject: [PATCH] feat(auth): wire verification code endpoints --- lib/api/auth-extra.ts | 10 +++++++--- lib/api/email.ts | 13 ++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/api/auth-extra.ts b/lib/api/auth-extra.ts index b3c5ae5..6c5255c 100644 --- a/lib/api/auth-extra.ts +++ b/lib/api/auth-extra.ts @@ -1,4 +1,8 @@ -export function sendForgotPasswordCode(email: string): never { - void email - throw new Error("Not implemented") +import { httpJson } from "./http" + +export async function sendForgotPasswordCode(email: string): Promise { + await httpJson("/api/v1/auth/forgot-password/send", { + method: "POST", + json: { email }, + }) } diff --git a/lib/api/email.ts b/lib/api/email.ts index 1ac650f..58b6220 100644 --- a/lib/api/email.ts +++ b/lib/api/email.ts @@ -1,4 +1,11 @@ -export function sendEmailVerificationCode(input: { email: string; scene: string }): never { - void input - throw new Error("Not implemented") +import { httpJson } from "./http" + +export async function sendEmailVerificationCode(input: { + email: string + scene: string +}): Promise { + await httpJson("/api/v1/email/verification-code/send", { + method: "POST", + json: { email: input.email, scene: input.scene }, + }) }