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

username/options

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

Username plugin - minUsernameLength option

The minUsernameLength option sets the minimum length of the username. The default value is 3. Configure it by passing minUsernameLength as a number in the username plugin options.

Username plugin - maxUsernameLength option

The maxUsernameLength option sets the maximum length of the username. The default value is 30. Configure it by passing maxUsernameLength as a number in the username plugin options.

Username plugin - usernameValidator option

The usernameValidator option accepts a function that validates the username. The function should return false if the username is invalid, true otherwise. By default, usernames can only contain alphanumeric characters, underscores, and dots.

Username plugin - displayUsernameValidator option

The displayUsernameValidator option accepts a function that validates the display username. The function should return false if the display username is invalid, true otherwise. By default, no validation is applied to display username.

Username plugin - usernameNormalization option

The usernameNormalization option accepts a function that normalizes the username, or false to disable normalization. By default, usernames are normalized to lowercase, so 'TestUser' and 'testuser' are considered the same. The username field contains the normalized (lowercase) version while displayUsername contains the original value.

Username plugin - displayUsernameNormalization option

The displayUsernameNormalization option accepts a function that normalizes the display username, or false to disable normalization. By default, display usernames are not normalized. When only username is provided during signup or update, the displayUsername will be set to match the original username value (before normalization). You can explicitly set a displayUsername which will be preserved as-is.

Username plugin - validationOrder option

The validationOrder option controls when username and display username validation occurs relative to normalization. By default, validation occurs before normalization (pre-normalization). You can set validationOrder to 'post-normalization' for username, displayUsername, or both to validate after normalization is applied.

Username plugin - disabling is-username-available endpoint

By default, the plugin exposes an endpoint POST /is-username-available to check if a username is available. You can disable this endpoint by providing disabledPaths: ['/is-username-available'] in the betterAuth configuration. This is useful if you want to protect usernames from being enumerated.

Give your agent this brain