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

Blitz Auth Adapter #8011

Closed
wants to merge 0 commits into from
Closed

Blitz Auth Adapter #8011

wants to merge 0 commits into from

Conversation

siddhsuresh
Copy link

☕️ Reasoning

Hello @balazsorban44! I hope you're doing well. I wanted to reach out as one of the maintainers of blitz-js. In our efforts to enhance blitz, we have developed an adapter that works in conjunction with next-auth to provide users with the ability to utilize blitz-auth API seamlessly with next-auth's OAuth providers.

Throughout our development process, we encountered several obstacles while utilizing next-auth's Internal API directly (as expected). As a result, we have initiated a pull request (PR) to address these challenges.

This PR will facilitate us to make the adapter more stable, rather than relying on runtime patching and allow other external libraries to be build on top of @auth/core and next-auth.

Thank you.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Fixes: #7941 blitz-js/blitz#4143 blitz-js/blitz#4171

📌 Resources

@vercel
Copy link

vercel bot commented Jul 11, 2023

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

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2023 5:59am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Jul 14, 2023 5:59am

@vercel
Copy link

vercel bot commented Jul 11, 2023

@siddhsuresh is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the legacy Refers to `next-auth` v4. Minimal maintenance. label Jul 11, 2023
Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

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

Thanks! I'm happy to help move this forward!

next-auth will remain Next.js specific, and we do not plan to expose internal APIs, so this PR in its current form won't be accepted. I'm happy to investigate though how we can make @auth/core more flexible, which is the intended package for library/framework authors to build on top of.

Note that #7443 is going to refactor the internals of next-auth significantly, so that is another reason these changes are not going to work in the long term.

@github-actions github-actions bot removed the legacy Refers to `next-auth` v4. Minimal maintenance. label Jul 11, 2023
@siddhsuresh
Copy link
Author

siddhsuresh commented Jul 11, 2023

Thanks! I'm happy to help move this forward!

next-auth will remain Next.js specific, and we do not plan to expose internal APIs, so this PR in its current form won't be accepted. I'm happy to investigate though how we can make @auth/core more flexible, which is the intended package for library/framework authors to build on top of.

Note that #7443 is going to refactor the internals of next-auth significantly, so that is another reason these changes are not going to work in the long term.

Hey @balazsorban44 thank you for the quick response!

Understood. I have reverted the changes regarding exposing internals of next-auth.

I am yet to get a proper development environment here, so I cannot say for certain. But during my research process before building the current adapter, I found that I needed these 3 functions from @auth/core: init, callback and authorization-url to make it functional. Which I have now exposed in this PR.

This will allow us to pivot our adapter to work directly with @auth/core.

@balazsorban44
Copy link
Member

Can you point me where these are invoked in blitz?

@siddhsuresh
Copy link
Author

siddhsuresh commented Jul 11, 2023

@balazsorban44 here,
https://github.com/blitz-js/blitz/blob/da76acc90a562b9655b3d894a21e0f441ef51ad9/packages/blitz-auth/src/server/adapters/next-auth/adapter.ts#L30C1-L30C1
It is currently setup for next-auth but as far as I last checked, the functionality of these functions did not change much. (Please correct me, if I am mistaken)

@siddhsuresh
Copy link
Author

siddhsuresh commented Jul 14, 2023

Hey @balazsorban44, would you like me to re implement this with @auth/core and then would this request be accepted? Or are the other concerns with exposing these functions?

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.

Incomplete list in package.json "exports" section
2 participants