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: users unable to authenticate with twitch auth #5279

Merged
merged 1 commit into from
May 13, 2022

Conversation

ebiggz
Copy link
Contributor

@ebiggz ebiggz commented May 11, 2022

This fixes the Twitch auth strategy which currently displays "Oops, something went wrong...Failed to fetch user profile" when users attempt to authenticate.

Cause

On May 1 2021, Twitch began requiring a "Client-Id" header for all Helix API calls. The current Twitch passport strategy package (passport-twitch-oauth) has not been updated to account for this, thus its /users call to the Twitch API always fails.

Code in question: https://github.com/mattgaunt/passport-twitch/blob/master/lib/strategy.js#L75-L76

Proposed Fix

Given the passport-twitch-oauth package has not received any updates for 4 years since it's initial 1.0 release, I opted to move to a more maintained package instead of trying to submit a fix to the current one. After some searching, passport-twitch-strategy appeared to be the best option out there right now.

The only code that needed to be updated to account for the strategy change was the picture property as this new strategy passes along Twitch response data as-is instead of mapping it.

Testing

Setup a twitch auth in local dev environment and ensured I was able to successfully authenticate
May-11-2022 03-45-23

@auto-assign auto-assign bot requested a review from NGPixel May 11, 2022 08:49
@NGPixel NGPixel merged commit 9b40d60 into requarks:main May 13, 2022
jionggyu pushed a commit to jionggyu/wiki-2.5.302-patch that referenced this pull request Jul 9, 2024
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.

2 participants