Files
tonePage/apps/frontend/app/console/login/components/PasskeyLoginPage.tsx

24 lines
902 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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);
}