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

docs(providers): add tip about async provider code #2443

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

ndom91
Copy link
Member

@ndom91 ndom91 commented Jul 28, 2021

Reasoning 💡

Adds tip regarding using async code in ones provider instantiation. Wasn't sure if this was the best place to put this, but it seemed appropriate enough. Im open to any other suggestions though obviously 👍

Checklist 🧢

  • Documentation
  • [ ] Tests
  • Ready to be merged

Affected issues 🎟

Related: #2394

@vercel
Copy link

vercel bot commented Jul 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/ET2wpyQ4Ntu3maSesTuhTAJweJZ4
✅ Preview: https://next-auth-git-ndom91-docs-async-instantiation-nextauthjs.vercel.app

@github-actions github-actions bot added the hacktoberfest-docs Relates to documentation label Jul 28, 2021
@sastraxi
Copy link

sastraxi commented Aug 9, 2021

Perhaps I'm being daft, but shouldn't the async function return NextAuth(...? Right now it's just instantiating it and throwing the value away.

@balazsorban44
Copy link
Member

balazsorban44 commented Aug 10, 2021

It's a Next.js API route handler, nothing needs to be returned. It uses res.{json,end,send} to finish the response, that's why you send req and res to it. return might be the way in other frameworks like SvelteKit though, but we aren't there yet. (#2294)

@sastraxi
Copy link

@balazsorban44 ahh right, forgot the API route handlers work just like express. Thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-docs Relates to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants