Skip to content

feat(auth): add Zod validation for authentication utility endpoints#578

Closed
chrisyangxiaoqi wants to merge 3 commits into
Dev-Card:mainfrom
chrisyangxiaoqi:feat/auth-zod-validation
Closed

feat(auth): add Zod validation for authentication utility endpoints#578
chrisyangxiaoqi wants to merge 3 commits into
Dev-Card:mainfrom
chrisyangxiaoqi:feat/auth-zod-validation

Conversation

@chrisyangxiaoqi

Copy link
Copy Markdown

Summary

Add request validation for and using Zod schemas, as described in #540.

Changes

  • New file :

    • : validates that is a valid UUID
    • : validates optional string in request body
  • Updated :

    • : validates request body with before processing
    • : validates request body with
  • New test file :

    • Tests for valid/invalid UUID in
    • Tests for (string, optional, non-string rejection)

Acceptance Criteria

  • uses Zod validation
  • uses Zod validation
  • Invalid requests are rejected with validation errors
  • Tests added for validation success and failure cases

Part of #540

Add request validation for /auth/mobile/exchange and /auth/refresh
using Zod schemas, as described in Dev-Card#540.

- New file: apps/backend/src/validations/auth.validation.ts
  - mobileExchangeSchema: validates UUID exchange code
  - refreshTokenSchema: validates optional refresh_token in body
- Updated apps/backend/src/routes/auth.ts:
  - /auth/mobile/exchange now validates request body with mobileExchangeSchema
  - /auth/refresh now validates request body with refreshTokenSchema
- New test file: apps/backend/src/__tests__/auth.validation.test.ts

Part of Dev-Card#540
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added backend gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. labels Jun 14, 2026
@github-actions

Copy link
Copy Markdown

Hi @chrisyangxiaoqi,

Thanks for opening this pull request.

This PR has been automatically classified based on the files modified.

Applied Labels

  • gssoc:approved
  • backend

Primary Review Area

  • backend

Reviewer

@Harxhit has been identified as the primary reviewer for this pull request.

If you have any questions regarding the affected area or implementation details, feel free to reach out to the assigned reviewer.

Thank you for your contribution!

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

CI — All Checks Passed

Backend — PASS

Check Result
Lint PASS
Test PASS
Typecheck PASS

Mobile — SKIP

Check Result
Lint -
Test -

Web — SKIP

Check Result
Check -
Build -

Last updated: Sun, 14 Jun 2026 20:12:55 GMT

chrisyangxiaoqi added 2 commits June 15, 2026 03:55
Remove .js extension from TypeScript import to fix lint error.

Part of Dev-Card#540
Group all parent (../) imports together with no empty lines,
add empty line before type imports group.

Fixes Dev-Card#540
@chrisyangxiaoqi

Copy link
Copy Markdown
Author

Hi, gentle ping on this PR. All CI checks are passing. Would appreciate a review. Thanks!

@chrisyangxiaoqi

Copy link
Copy Markdown
Author

Hi @Dev-Card/maintainers, requesting a review for this PR. It fixes the backend to return proper JSON response and adds CORS support. Tests added. Thanks!

@Harxhit

Harxhit commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Thank you for contribution as your pr is duplicate and issue is not assigned to you closing the pull request please pick issues that are not assigned to any contributors.

@Harxhit Harxhit closed this Jun 15, 2026
@Harxhit Harxhit added the duplicate This issue or pull request already exists label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend duplicate This issue or pull request already exists gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants