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

two-factor/otp

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.

OTP configuration in auth setup

Before using OTP for 2FA, configure sendOTP in the 2FA plugin options. This is a function responsible for sending OTP to user's email, phone, or other method. Example: twoFactor({ otpOptions: { async sendOTP({ user, otp }, ctx) { /* send otp to user */ } } })

Sending OTP endpoint and parameters

POST /two-factor/send-otp requires headers. Parameters: trustDevice (boolean, optional, default true, if true device is trusted for 30 days and refreshed on every sign-in). Call authClient.twoFactor.sendOtp on client or auth.api.sendTwoFactorOTP on server to trigger the sendOTP implementation.

Verifying OTP endpoint and parameters

POST /two-factor/verify-otp requires headers. Parameters: code (string, required, the OTP code to verify), trustDevice (boolean, optional, default true, if true device is trusted for 30 days and refreshed on every sign-in). Call authClient.twoFactor.verifyOtp on client or auth.api.verifyTwoFactorOTP on server.

Give your agent this brain