Skip to content

Commit

Permalink
fix: make lucia validation error messages more descriptive (#363)
Browse files Browse the repository at this point in the history
* make Validation Error messages of registration more descriptive

* Create wet-students-taste.md

---------

Co-authored-by: Manuel <30698007+manuel3108@users.noreply.github.com>
  • Loading branch information
fbehrens and manuel3108 authored Dec 23, 2024
1 parent b25077c commit 64fdfd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-students-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"sv": patch
---

fix: make `lucia` validation error messages more descriptive
4 changes: 2 additions & 2 deletions packages/addons/lucia/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ export default defineAddon({
const password = formData.get('password');
if (!validateUsername(username)) {
return fail(400, { message: 'Invalid username' });
return fail(400, { message: 'Invalid username (min 3, max 31 characters, alphanumeric only)' });
}
if (!validatePassword(password)) {
return fail(400, { message: 'Invalid password' });
return fail(400, { message: 'Invalid password (min 6, max 255 characters)' });
}
const results = await db
Expand Down

0 comments on commit 64fdfd2

Please sign in to comment.