Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/osvscanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
uses: actions/checkout@v4
- name: Run OSV-Scanner
uses: google/osv-scanner-action/osv-scanner-action@9a498708959aeaef5ef730655706c5a1df1edbc2
uses: google/osv-scanner-action/osv-scanner-action@v1.9.0
Comment on lines 17 to +20
with:
scan-args: |-
--recursive
Expand Down
14 changes: 14 additions & 0 deletions packages/shared/src/schemas/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ describe('LoginRequestSchema', () => {
LoginRequestSchema.safeParse({ email: 'a@b.com', password: '1234567' }).success,
).toBe(false)
})

it('๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ 1025์ž ์ด์ƒ์ด๋ฉด ์‹คํŒจํ•œ๋‹ค (max 1024 ๊ฒฝ๊ณ„)', () => {
const longPassword = 'a'.repeat(1025)
expect(
LoginRequestSchema.safeParse({ email: 'a@b.com', password: longPassword }).success,
).toBe(false)
})
Comment on lines +23 to +28
})

describe('RegisterRequestSchema', () => {
Expand All @@ -33,6 +40,13 @@ describe('RegisterRequestSchema', () => {
RegisterRequestSchema.safeParse({ email: 'a@b.com', password: '12345678', name: 'k' }).success,
).toBe(true)
})

it('๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ 1025์ž ์ด์ƒ์ด๋ฉด ์‹คํŒจํ•œ๋‹ค (max 1024 ๊ฒฝ๊ณ„)', () => {
const longPassword = 'a'.repeat(1025)
expect(
RegisterRequestSchema.safeParse({ email: 'a@b.com', password: longPassword, name: 'k' }).success,
).toBe(false)
})
Comment on lines +44 to +49
})

describe('ExchangeRequestSchema', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/schemas/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { z } from 'zod'

export const LoginRequestSchema = z.object({
email: z.string().email(),
password: z.string().min(8),
password: z.string().min(8).max(1024),
})
Comment on lines 3 to 6
Comment on lines 3 to 6

export const RegisterRequestSchema = z.object({
email: z.string().email(),
password: z.string().min(8),
password: z.string().min(8).max(1024),
name: z.string().min(1),
})
Comment on lines 8 to 12

Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/app/api/password-reset/[token]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const dynamic = 'force-dynamic'

const ResetPasswordSchema = z
.object({
password: z.string().min(8),
passwordConfirmation: z.string().min(8),
password: z.string().min(8).max(1024),
passwordConfirmation: z.string().min(8).max(1024),
Comment on lines +15 to +16
})
Comment on lines 13 to 17
.refine((value) => value.password === value.passwordConfirmation, {
path: ['passwordConfirmation'],
Expand Down
Loading