diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-07 03:24:42 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-07 03:24:46 +0900 |
| commit | 26df54a09d7e195d0e33266e0b34f8e11d072277 (patch) | |
| tree | ca7f47d8beb4fcea7419350852b845b8a3179ec1 /src/server/routes/auth.ts | |
| parent | 39deb471d976d863d2ec803f908025a2366f1486 (diff) | |
| download | kioku-26df54a09d7e195d0e33266e0b34f8e11d072277.tar.gz kioku-26df54a09d7e195d0e33266e0b34f8e11d072277.tar.zst kioku-26df54a09d7e195d0e33266e0b34f8e11d072277.zip | |
feat(client): remove registration page
Diffstat (limited to 'src/server/routes/auth.ts')
| -rw-r--r-- | src/server/routes/auth.ts | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/server/routes/auth.ts b/src/server/routes/auth.ts index 144bbae..06c88a6 100644 --- a/src/server/routes/auth.ts +++ b/src/server/routes/auth.ts @@ -10,11 +10,7 @@ import { type UserRepository, userRepository, } from "../repositories/index.js"; -import { - createUserSchema, - loginSchema, - refreshTokenSchema, -} from "../schemas/index.js"; +import { loginSchema, refreshTokenSchema } from "../schemas/index.js"; function getJwtSecret(): string { const secret = process.env.JWT_SECRET; @@ -43,23 +39,6 @@ export function createAuthRouter(deps: AuthDependencies) { const { userRepo, refreshTokenRepo } = deps; return new Hono() - .post("/register", zValidator("json", createUserSchema), async (c) => { - const { username, password } = c.req.valid("json"); - - // Check if username already exists - const exists = await userRepo.existsByUsername(username); - if (exists) { - throw Errors.conflict("Username already exists", "USERNAME_EXISTS"); - } - - // Hash password with Argon2 - const passwordHash = await argon2.hash(password); - - // Create user - const newUser = await userRepo.create({ username, passwordHash }); - - return c.json({ user: newUser }, 201); - }) .post("/login", zValidator("json", loginSchema), async (c) => { const { username, password } = c.req.valid("json"); |
