new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Plugins · all subjects

passkey/signin

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Passkey conditional UI requirements

To enable conditional UI (browser autofill), two requirements must be met: First, add the autocomplete attribute with value 'webauthn' to input fields, with 'webauthn' as the last entry in the autocomplete attribute. Second, check if the browser supports conditional UI with PublicKeyCredential.isConditionalMediationAvailable() before calling authClient.signIn.passkey({ autoFill: true }). Some browsers require user interaction with the input field before the autofill prompt appears.

Example: Sign in with passkey and post-auth redirect

Example of signing in with a passkey and handling success/error: import { authClient } from "@/lib/auth-client"; await authClient.signIn.passkey({ autoFill: true, extensions: { credProps: true }, fetchOptions: { onSuccess(context) { window.location.href = "/dashboard"; }, onError(context) { console.error("Authentication failed:", context.error.message); } } });

Example: Conditional UI implementation

Example of implementing conditional UI with passkeys using React: HTML with autocomplete attributes: <label for="name">Username:</label> <input type="text" name="name" autocomplete="username webauthn"> <label for="password">Password:</label> <input type="password" name="password" autocomplete="current-password webauthn"> React component with browser support check: useEffect(() => { if (!PublicKeyCredential.isConditionalMediationAvailable || !PublicKeyCredential.isConditionalMediationAvailable()) { return; } void authClient.signIn.passkey({ autoFill: true }) }, [])

Give your agent this brain