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

migrated to Auth.js v5 from nextAuth and Edge runtime compatibility fixes #916

Closed
ankitmukhia opened this issue Aug 19, 2024 · 1 comment

Comments

@ankitmukhia
Copy link
Contributor

Title

"Migrated to Auth.js v5 from NextAuth and Edge Runtime Compatibility Fixes"

Problem Description

  1. Outdated NextAuth.js Version
    • The project was using an old version of next-auth, incompatible with the new designs folder structure. This caused issues with authentication flows and required updates to middleware and session management.
  2. Bcrypt Incompatibility with Edge Runtime
  3. ORM compt
  • Traditional ORMs had issues running in the Edge runtime

Solution

  1. Migration to Auth.js v5
    • Upgraded to authjs v5.
    • Refactored folder structure to align with the new design.
    • Implemented necessary middleware and updated session management to use the new universal methods.
  2. Replacing Bcrypt
    • Switched from bcrypt to an Edge-compatible alternative like bcryptjs.
    • And added nw login form.
  3. edgee-Compatible
  • splited authentication config into separate files. this change ensures that we use a session strategy that’s compatible with the edge environment,
@itzamanjain
Copy link

@ankitmukhia the PR is adding 11k+ lines and deleting many lines of code. I am also getting a similar issue in which I only changed one file, but when opening a PR it shows that I changed 10 files and added many lines. However, the other code is from someone else. How can I fix this? Do you have any ideas?

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 a pull request may close this issue.

3 participants