Skip to content

Commit da4ab5e

Browse files
authored
make Validation Error messages of registration more descriptive
1 parent 3b9fbcd commit da4ab5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/addons/lucia/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,10 @@ export default defineAddon({
398398
const password = formData.get('password');
399399
400400
if (!validateUsername(username)) {
401-
return fail(400, { message: 'Invalid username' });
401+
return fail(400, { message: 'Invalid username (min 3, max 31 characters, alphanumeric only)' });
402402
}
403403
if (!validatePassword(password)) {
404-
return fail(400, { message: 'Invalid password' });
404+
return fail(400, { message: 'Invalid password (min 6, max 255 characters)' });
405405
}
406406
407407
const results = await db

0 commit comments

Comments
 (0)