feat: 前端现在支持通行证登录辣~

This commit is contained in:
2025-12-18 22:41:44 +08:00
parent eddc4b1b76
commit e3a50adea8
2 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
import { AuthAPI } from "@/lib/api/client";
import LoginHeader from "./LoginHeader";
import { Button } from "@/components/ui/button";
import { startAuthentication } from "@simplewebauthn/browser";
export default function PasskeyLoginPage() {
return (
<>
<LoginHeader h2="使用通行证登录到您的账户" />
<div className="h-37.5 flex justify-center items-center">
<span className="text-sm text-zinc-500 border rounded-2xl p-5"></span>
</div>
<Button type="submit" className="w-full">
</Button>
</>
)
}
export async function handleSubmit() {
const optionsJSON = await AuthAPI.getLoginByPasskeyOptions();
const credentialResponse = await startAuthentication({ optionsJSON });
return AuthAPI.loginByPasskey(credentialResponse);
}