From d7eeb3ca75266c8d08d5f00d7243765d95486429 Mon Sep 17 00:00:00 2001 From: GhoStalker Date: Wed, 4 Mar 2020 19:26:08 -0600 Subject: [PATCH] fix: Resolve Twitch OAuth API - fixes #1268 --- package.json | 2 +- server/modules/authentication/twitch/authentication.js | 4 ++-- server/modules/authentication/twitch/definition.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 73b1930894..23db41bf4a 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,7 @@ "passport-okta-oauth": "0.0.1", "passport-openidconnect": "0.0.2", "passport-saml": "1.3.3", - "passport-twitch": "1.0.3", + "passport-twitch-oauth": "1.0.0", "pem-jwk": "2.0.0", "pg": "7.18.2", "pg-hstore": "2.3.3", diff --git a/server/modules/authentication/twitch/authentication.js b/server/modules/authentication/twitch/authentication.js index e87dfba768..78b1dc041f 100644 --- a/server/modules/authentication/twitch/authentication.js +++ b/server/modules/authentication/twitch/authentication.js @@ -4,7 +4,7 @@ // Twitch Account // ------------------------------------ -const TwitchStrategy = require('passport-twitch').Strategy +const TwitchStrategy = require('passport-twitch-oauth').Strategy const _ = require('lodash') module.exports = { @@ -19,7 +19,7 @@ module.exports = { const user = await WIKI.models.users.processProfile({ profile: { ...profile, - picture: _.get(profile, '_json.logo', '') + picture: _.get(profile, 'avatar', '') }, providerKey: 'twitch' }) diff --git a/server/modules/authentication/twitch/definition.yml b/server/modules/authentication/twitch/definition.yml index 02e653ee39..aedda607f5 100644 --- a/server/modules/authentication/twitch/definition.yml +++ b/server/modules/authentication/twitch/definition.yml @@ -8,7 +8,7 @@ website: https://dev.twitch.tv/docs/authentication/ isAvailable: true useForm: false scopes: - - user_read + - 'user:read:email' props: clientId: type: String