aboutsummaryrefslogtreecommitdiffhomepage
path: root/pkgs/shared
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-03 05:28:29 +0900
committernsfisis <nsfisis@gmail.com>2025-12-04 23:26:25 +0900
commit950217ed3ca93a0aa0e964c2a8474ffc13c71912 (patch)
treef5a8575a74aa8203a8fd49846ab859670009ffd7 /pkgs/shared
parent7e75e0fa8f26a7890c210c67e4474778811b15bc (diff)
downloadkioku-950217ed3ca93a0aa0e964c2a8474ffc13c71912.tar.gz
kioku-950217ed3ca93a0aa0e964c2a8474ffc13c71912.tar.zst
kioku-950217ed3ca93a0aa0e964c2a8474ffc13c71912.zip
feat(auth): add user registration endpoint
Implement POST /api/auth/register endpoint with: - Argon2 password hashing - Zod validation for username (1-255 chars) and password (8-255 chars) - Duplicate username check (returns 409 Conflict) - Returns created user with id, username, and createdAt 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'pkgs/shared')
-rw-r--r--pkgs/shared/package.json9
-rw-r--r--pkgs/shared/src/schemas/index.ts2
2 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/shared/package.json b/pkgs/shared/package.json
index d208456..8c50a8b 100644
--- a/pkgs/shared/package.json
+++ b/pkgs/shared/package.json
@@ -2,7 +2,14 @@
"name": "@kioku/shared",
"version": "0.1.0",
"private": true,
- "main": "index.js",
+ "main": "./src/index.ts",
+ "types": "./src/index.ts",
+ "exports": {
+ ".": {
+ "types": "./src/index.ts",
+ "import": "./src/index.ts"
+ }
+ },
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
diff --git a/pkgs/shared/src/schemas/index.ts b/pkgs/shared/src/schemas/index.ts
index c211381..28b5f55 100644
--- a/pkgs/shared/src/schemas/index.ts
+++ b/pkgs/shared/src/schemas/index.ts
@@ -28,7 +28,7 @@ export const userSchema = z.object({
// User creation input schema
export const createUserSchema = z.object({
username: z.string().min(1).max(255),
- password: z.string().min(8).max(255),
+ password: z.string().min(15).max(255),
});
// Login input schema