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

fix: reject access token if slack login flow was canceled #1544

Merged
merged 2 commits into from
Mar 18, 2021
Merged

fix: reject access token if slack login flow was canceled #1544

merged 2 commits into from
Mar 18, 2021

Conversation

mrmurb
Copy link
Contributor

@mrmurb mrmurb commented Mar 18, 2021

What:
Access token parsing when the provider is Slack.

Why:
If the user canceled the login flow when on Slack's consent page the application would crash when trying to read access token from response body.
Closes #1513.

How:
Slack responds with an ok: boolean property in the body object. If it's false we reject the auth flow. Else continue as before.

Checklist:

  • Documentation - N/A
  • Tests
  • Ready to be merged

@vercel
Copy link

vercel bot commented Mar 18, 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/Atw1gdfyRN9VNMFkGRoAQi48NWUs
✅ Preview: https://next-auth-git-fork-mrmurb-fix-slack-canceled-auth-nextauthjs.vercel.app

@vercel vercel bot temporarily deployed to Preview March 18, 2021 09:52 Inactive
@github-actions github-actions bot added the core Refers to `@auth/core` label Mar 18, 2021
@vercel vercel bot temporarily deployed to Preview March 18, 2021 09:55 Inactive
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 so much! Looks good to me! 🙂

@balazsorban44 balazsorban44 merged commit 237b016 into nextauthjs:main Mar 18, 2021
@github-actions
Copy link

🎉 This PR is included in version 3.13.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mrmurb mrmurb deleted the fix/slack-canceled-auth branch March 18, 2021 15:25
@github-actions
Copy link

🎉 This PR is included in version 4.0.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

mnphpexpert added a commit to mnphpexpert/next-auth that referenced this pull request Sep 2, 2024
…extauthjs#1544)

* fix: reject access token if slack login flow was canceled

* style: fix lint errors in oauth client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when user cancels login flow for Slack
2 participants