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

Made ctxOrReq optional in getCsrfToken() #1850

Merged
merged 1 commit into from
Apr 25, 2021
Merged

Made ctxOrReq optional in getCsrfToken() #1850

merged 1 commit into from
Apr 25, 2021

Conversation

typedashutosh
Copy link
Contributor

@typedashutosh typedashutosh commented Apr 25, 2021

What: Made ctxOrReq optional in getCsrfToken()

Why: Because in client it was unnecessary, but when used with typescript, TS makes unnecessary complaints.

How: Just adding a ? at param of the function. getCsrfToken(ctxOrReq?: ctxOrReq)

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

fixes #1847

@vercel
Copy link

vercel bot commented Apr 25, 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/4vqXKKRHopULPEjUj2gkdFwyU65y
✅ Preview: https://next-auth-git-fork-typedashutosh-patch-1-nextauthjs.vercel.app

@vercel vercel bot temporarily deployed to Preview April 25, 2021 11:50 Inactive
@github-actions github-actions bot added the TypeScript Issues relating to TypeScript label Apr 25, 2021
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.

Thank you! 🙂

@balazsorban44 balazsorban44 merged commit 07e2a83 into nextauthjs:main Apr 25, 2021
@typedashutosh
Copy link
Contributor Author

The same problem occurs with getSession() asking for empty object. Should I do it too?
😀

@balazsorban44
Copy link
Member

please do! 🙏😄

@typedashutosh
Copy link
Contributor Author

Done. #1851

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeScript Issues relating to TypeScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getCsrfToken() requires an empty object when called on client side
2 participants