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: add user-agent to patreon oauth requests #20305

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tewson
Copy link

@tewson tewson commented May 13, 2024

What does it do?

The users & permissions plugin has a provider for logging in via Patreon. Recently requests to Patreon started to fail with a 400 error. It appears to be because of the lack of a User-Agent header in the requests. This PR adds the User-Agent header similar to the existing GitHub provider.

See a related discussion including Patreon's response at https://www.patreondevelopers.com/t/status-400-https-www-patreon-com-api-oauth2-v2-identity/8836/9.

Why is it needed?

Without this PR, logging in via Patreon always fails.

How to test it?

  1. Get set up on Patreon as a creator and create a client on https://www.patreon.com/portal.
  2. In the Users & Permissions plugin, enable the Patreon provider and configure the client based on the info from Patreon.
  3. Set up a user in Strapi that has the same email address as a subscriber on your Patreon creator account.
  4. Create a simple front end app that Patreon redirects back to. The front end app needs to send a GET request to api/auth/patreon/callback with the data that Patreon sends back in the URL redirection. This request should return the correct user.

Related issue(s)/PR(s)

N/A

from lack of user-agent header
Copy link

vercel bot commented May 13, 2024

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

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 10:26pm

@strapi-cla
Copy link

strapi-cla commented May 13, 2024

CLA assistant check
All committers have signed the CLA.

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

2 participants