Skip to content

Feat/auth context - #16

Merged
Yuvraj-Sarathe merged 3 commits into
Omnikon-Org:mainfrom
Shantanusongirkar:feat/auth-context
Jul 1, 2026
Merged

Feat/auth context#16
Yuvraj-Sarathe merged 3 commits into
Omnikon-Org:mainfrom
Shantanusongirkar:feat/auth-context

Conversation

@Shantanusongirkar

Copy link
Copy Markdown
Contributor

Summary

This PR implements the authentication foundation for the backend API by introducing a typed tRPC context and protected procedures. It prepares the backend for upcoming authentication routes and secured endpoints without changing the database schema or frontend implementation.

Changes

Authentication Context

  • Added a dedicated context.ts
  • Implemented typed createContext
  • Added session resolution for incoming requests
  • Injected infrastructure dependencies (Prisma, Logger, Socket.IO, BullMQ)

tRPC

  • Added typed Context
  • Implemented protectedProcedure
  • Added authentication middleware for protected routes
  • Preserved existing publicProcedure

API Integration

  • Integrated the new authentication context into the Express tRPC middleware
  • Kept existing API routes and middleware unchanged

Testing

Verified locally:

  • ✅ API starts successfully
  • ✅ TypeScript compiles without errors
  • ✅ Public procedures remain accessible
  • ✅ Protected procedures return UNAUTHORIZED when no valid session exists
  • ✅ Valid sessions authenticate successfully
  • ✅ Expired sessions are rejected

Notes

  • No Prisma schema changes
  • No database migrations required for this feature
  • No frontend modifications
  • No role middleware implemented yet
  • Authentication routers will be implemented in a separate PR

@mergify

mergify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Yuvraj-Sarathe
Yuvraj-Sarathe merged commit 70a2f4d into Omnikon-Org:main Jul 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants