From da4ab5e0deb2a3fc1fc4360a93ee90b55f029403 Mon Sep 17 00:00:00 2001 From: Frank Behrens Date: Tue, 17 Dec 2024 21:55:27 +0100 Subject: [PATCH 1/2] make Validation Error messages of registration more descriptive --- packages/addons/lucia/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/lucia/index.ts b/packages/addons/lucia/index.ts index ba5e19d62..d064c8073 100644 --- a/packages/addons/lucia/index.ts +++ b/packages/addons/lucia/index.ts @@ -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 From 77585cd4e800205116605413b1b930d0696304de Mon Sep 17 00:00:00 2001 From: Manuel <30698007+manuel3108@users.noreply.github.com> Date: Mon, 23 Dec 2024 08:00:52 +0100 Subject: [PATCH 2/2] Create wet-students-taste.md --- .changeset/wet-students-taste.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wet-students-taste.md diff --git a/.changeset/wet-students-taste.md b/.changeset/wet-students-taste.md new file mode 100644 index 000000000..0acd77b3b --- /dev/null +++ b/.changeset/wet-students-taste.md @@ -0,0 +1,5 @@ +--- +"sv": patch +--- + +fix: make `lucia` validation error messages more descriptive