Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication System Refactor #203

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Authentication System Refactor #203

wants to merge 1 commit into from

Conversation

atrincas
Copy link
Collaborator

Authentication System Refactor

Changes

This PR refactors the authentication system by:

  1. Removing NextAuth.js dependency in favor of a custom auth implementation using jose for JWT handling
  2. Introducing a new auth context and provider for managing authentication state
  3. Centralizing auth logic in new /lib/auth directory
  4. Updating all components and pages to use the new auth system

Key Updates

  • Removed /app/auth/api/[...nextauth] route and configuration
  • Added jose package for JWT handling
  • Created new auth context with login/logout functionality
  • Updated middleware to use new auth system
  • Modified all components using useSession() to use new useAuth() hook
  • Centralized session types and auth utilities

Testing

Please verify:

  • Login flow works correctly
  • Protected routes remain secure
  • Session persistence works as expected
  • Logout functionality works properly

Notes

This change improves maintainability by:

  • Reducing external dependencies
  • Centralizing auth logic
  • Providing better type safety
  • Making the auth system more customizable

The changes are backwards compatible and should not affect existing functionality.

Copy link

vercel bot commented Dec 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tnc-blue-carbon-cost-tool-ghps ❌ Failed (Inspect) Dec 30, 2024 11:37am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant