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 · Reference · all subjects

options/errors

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

onAPIError option fields

The onAPIError option has the following fields: throw (throw error on API error; default: false), onError (custom error handler receiving error and ctx), errorURL (URL to redirect to on error; default: '/api/auth/error'), customizeDefaultErrorPage (object to configure default error page with colors, size, font, and boolean options to disable features).

onAPIError.customizeDefaultErrorPage.colors

The customizeDefaultErrorPage.colors object has the following fields: background, foreground, primary, primaryForeground, mutedForeground, border, destructive, titleBorder, titleColor, gridColor, cardBackground, cornerBorder.

onAPIError.customizeDefaultErrorPage.size

The customizeDefaultErrorPage.size object has the following fields: radiusSm (small border radius), radiusMd (medium border radius), radiusLg (large border radius), textSm (small text size), text2xl (2xl text size), text4xl (4xl text size), text6xl (6xl text size).

onAPIError.customizeDefaultErrorPage.font

The customizeDefaultErrorPage.font object has the following fields: defaultFamily (default font family), monoFamily (monospace font family).

onAPIError.customizeDefaultErrorPage boolean options

The customizeDefaultErrorPage object has the following boolean fields: disableTitleBorder (disable border around title; default: false), disableCornerDecorations (disable corner decorations; default: false), disableBackgroundGrid (disable background grid pattern; default: false).

onAPIError example code

import { betterAuth } from "better-auth"; export const auth = betterAuth({ onAPIError: { throw: true, onError: (error, ctx) => { // Custom error handling console.error("Auth error:", error); }, errorURL: "/auth/error", customizeDefaultErrorPage: { colors: { background: "#ffffff", foreground: "#000000", primary: "#0070f3", primaryForeground: "#ffffff", mutedForeground: "#666666", border: "#e0e0e0", destructive: "#ef4444", titleBorder: "#0070f3", titleColor: "#000000", gridColor: "#f0f0f0", cardBackground: "#ffffff", cornerBorder: "#0070f3" }, size: { radiusSm: "0.25rem", radiusMd: "0.5rem", radiusLg: "1rem", textSm: "0.875rem", text2xl: "1.5rem", text4xl: "2.25rem", text6xl: "3.75rem" }, font: { defaultFamily: "system-ui, sans-serif", monoFamily: "monospace" }, disableTitleBorder: false, disableCornerDecorations: false, disableBackgroundGrid: false } }, })

Give your agent this brain