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

email-otp/options

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

Email OTP options: sendVerificationOnSignUp

The sendVerificationOnSignUp option is a boolean that determines whether to send the OTP when a user signs up. Defaults to false.

Email OTP options: disableSignUp

The disableSignUp option is a boolean that determines whether to prevent automatic sign-up when the user is not registered. Defaults to false.

Email OTP options: generateOTP

The generateOTP option is a function that generates the OTP. Defaults to a random 6-digit number.

Email OTP options: sendVerificationOTP callback

sendVerificationOTP is a required callback function that receives an object with email (user's email address), otp (the OTP to send), and type ('sign-in', 'email-verification', or 'forget-password'). It is recommended to not await email sending to avoid timing attacks; on serverless platforms use waitUntil or similar to ensure the email is sent.

Email OTP options: otpLength

The otpLength option sets the length of the generated OTP. Defaults to 6.

Email OTP options: expiresIn

The expiresIn option sets the expiry time of the OTP in seconds. Defaults to 300 seconds.

Email OTP options: allowedAttempts

The allowedAttempts option sets the maximum number of attempts allowed for verifying an OTP. Defaults to 3. After exceeding this limit, the OTP becomes invalid and the user needs to request a new one. When exceeded, verifyOTP, signIn.emailOtp, verifyEmail, and resetPassword methods return an error with code TOO_MANY_ATTEMPTS.

Email OTP options: resendStrategy

The resendStrategy option controls what happens when a user requests a new OTP while an existing one is still valid. Defaults to 'rotate'. Values: 'rotate' (always generates a new OTP, default behavior) or 'reuse' (resends the same OTP and extends its expiry, prevents multiple valid codes from existing simultaneously when emails are delayed, only works when OTP is recoverable - plain, encrypted, or custom encrypt/decrypt, falls back to rotate when OTP is hashed, generates fresh OTP instead of reusing exhausted one if allowed attempts exceeded).

Email OTP options: storeOTP

The storeOTP option specifies the method used to transform the OTP before storage: 'encrypted', 'hashed', or 'plain' text. Defaults to 'plain' text. This only affects the stored OTP value, not the OTP sent to the user. The storage backend is controlled by the global verification config; if secondaryStorage is configured, verification records can live there instead of the database. Alternatively, pass a custom encryptor (with encrypt and decrypt async functions) or custom hasher (with hash async function) to control persistence.

Give your agent this brain