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

client-side authentication in Next.js with NextAuth.js #1207

Closed
wants to merge 11 commits into from

Conversation

ejirocodes
Copy link

What:

Why:

How:

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

Sorry, something went wrong.

@vercel
Copy link

vercel bot commented Jan 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/u7oab7bao
✅ Preview: https://next-auth-git-fork-ejirocodes-patch-1.nextauthjs.vercel.app

@vercel vercel bot temporarily deployed to Preview January 28, 2021 10:25 Inactive
@balazsorban44 balazsorban44 changed the base branch from main to canary January 28, 2021 10:35
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.

Please add PRs against the canary branch next time.

It is so unfortunate that we document this badly, but I see your tutorial does not mention either that the pageProps.session value in _app must come from somewhere! See #1132

The "How NextAuth.js works" section seems to be not fully explained. Although you are right about the default session value (we keep it minimal to be secure by default), you can extend it as you like, with the help of the jwt and session callbacks (see: https://next-auth.js.org/configuration/callbacks)

I think it is pretty important to say here that this is where you can provide an access_token that can be used to call APIs from the client that needs authentication. Since your tutorial tries to focus on client-side features of NextAuth.js, I feel it is very important to name. (We should actually add this to the documentation. Related issue: #1078)

Apart from that, the tutorial looks nice, but I don't feel it explains anything else the documentation already tells you. The requested changes should more likely be a part of the official docs, rather than in an arbitrary tutorial.

If you are interested in adding those pinpointed changes to the official docs, that would be more than welcome!

@ejirocodes
Copy link
Author

Please add PRs against the canary branch next time.

It is so unfortunate that we document this badly, but I see your tutorial does not mention either that the pageProps.session value in _app must come from somewhere! See #1132

The "How NextAuth.js works" section seems to be not fully explained. Although you are right about the default session value (we keep it minimal to be secure by default), you can extend it as you like, with the help of the jwt and session callbacks (see: https://next-auth.js.org/configuration/callbacks)

I think it is pretty important to say here that this is where you can provide an access_token that can be used to call APIs from the client that needs authentication. Since your tutorial tries to focus on client-side features of NextAuth.js, I feel it is very important to name. (We should actually add this to the documentation. Related issue: #1078)

Apart from that, the tutorial looks nice, but I don't feel it explains anything else the documentation already tells you. The requested changes should more likely be a part of the official docs, rather than in an arbitrary tutorial.

If you are interested in adding those pinpointed changes to the official docs, that would be more than welcome!

Please add PRs against the canary branch next time.

It is so unfortunate that we document this badly, but I see your tutorial does not mention either that the pageProps.session value in _app must come from somewhere! See #1132

The "How NextAuth.js works" section seems to be not fully explained. Although you are right about the default session value (we keep it minimal to be secure by default), you can extend it as you like, with the help of the jwt and session callbacks (see: https://next-auth.js.org/configuration/callbacks)

I think it is pretty important to say here that this is where you can provide an access_token that can be used to call APIs from the client that needs authentication. Since your tutorial tries to focus on client-side features of NextAuth.js, I feel it is very important to name. (We should actually add this to the documentation. Related issue: #1078)

Apart from that, the tutorial looks nice, but I don't feel it explains anything else the documentation already tells you. The requested changes should more likely be a part of the official docs, rather than in an arbitrary tutorial.

If you are interested in adding those pinpointed changes to the official docs, that would be more than welcome!

@balazsorban44 I'll add these issues you've pointed out to the official docs and also update my article! Sounds cool?

@balazsorban44
Copy link
Member

Awesome!

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.

None yet

3 participants