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

feat(#673): migrate to AuthJS #924

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

phoenix-ru
Copy link
Collaborator

πŸ”— Linked issue

#673

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Copy link

pkg-pr-new bot commented Oct 8, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@sidebase/nuxt-auth@924

commit: a6d41a3

// This header is set to force AuthJS to return JSON
// https://github.com/nextauthjs/next-auth/blob/b86f7bb721e2fa4e9c3251b029095b0f50d46198/packages/next-auth/src/react.tsx#L270-L285
// https://github.com/nextauthjs/next-auth/blob/b86f7bb721e2fa4e9c3251b029095b0f50d46198/packages/core/src/index.ts#L160
'X-Auth-Return-Redirect': '1',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new header which needs to be documented (or linked to authjs docs). We need to mention for users to add it to their header whitelists

@phoenix-ru
Copy link
Collaborator Author

phoenix-ru commented Oct 10, 2024

While testing the code in a private project, we unfortunately discovered that AuthJS itself errors on an existing codebase. Setting up a new project with the official Next starter results in the same error.

After an in-depth investigation, the issue lies with their new dependency oauth4webapi and the way it is used in new versions of AuthJS.

@kogratte
Copy link

Hello there!

Thanks you very much for letting us aware of the ongoing work.

From what I read, should I understand that the migration is now working for those not using a database? IE, we're using third party provider, aka keycloak. Should I expect the latest version to work as expected? If so, which version can I give a try?

@phoenix-ru
Copy link
Collaborator Author

now working for those not using a database?

Sorry for a misleading comment, I meant codebase 😨

The migration is simply not working - as stated, the issue is not on our side, but on the authjs side, namely the oauth4webapi they use. We tried their official Next.js starter (i.e. without this module and without Nuxt) and couldn't get it to work.

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.

3 participants