Skip to content

Commit

Permalink
fix: handle multi social auth strategies
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel authored Mar 26, 2022
1 parent 1f489a3 commit a652e43
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion server/modules/authentication/auth0/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Auth0Strategy = require('passport-auth0').Strategy

module.exports = {
init (passport, conf) {
passport.use('auth0',
passport.use(conf.key,
new Auth0Strategy({
domain: conf.domain,
clientID: conf.clientId,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/azure/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
keyString = keyString.substring(44);
}
}
passport.use('azure',
passport.use(conf.key,
new OIDCStrategy({
identityMetadata: conf.entryPoint,
clientID: conf.clientId,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/cas/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CASStrategy = require('passport-cas').Strategy

module.exports = {
init (passport, conf) {
passport.use('cas',
passport.use(conf.key,
new CASStrategy({
ssoBaseURL: conf.ssoBaseURL,
serverBaseURL: conf.serverBaseURL,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/discord/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('discord',
passport.use(conf.key,
new DiscordStrategy({
clientID: conf.clientId,
clientSecret: conf.clientSecret,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/dropbox/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('dropbox',
passport.use(conf.key,
new DropboxStrategy({
apiVersion: '2',
clientID: conf.clientId,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/facebook/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('facebook',
passport.use(conf.key,
new FacebookStrategy({
clientID: conf.clientId,
clientSecret: conf.clientSecret,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/firebase/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('firebase',
passport.use(conf.key,
new FirebaseStrategy({
clientID: conf.clientId,
clientSecret: conf.clientSecret,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/github/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
githubConfig.userEmailURL = `${conf.enterpriseUserEndpoint}/emails`
}

passport.use('github',
passport.use(conf.key,
new GitHubStrategy(githubConfig, async (req, accessToken, refreshToken, profile, cb) => {
try {
const user = await WIKI.models.users.processProfile({
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/gitlab/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('gitlab',
passport.use(conf.key,
new GitLabStrategy({
clientID: conf.clientId,
clientSecret: conf.clientSecret,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/google/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
}
}

passport.use('google', strategy)
passport.use(conf.key, strategy)
},
logout (conf) {
return '/'
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/keycloak/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const KeycloakStrategy = require('@exlinc/keycloak-passport')

module.exports = {
init (passport, conf) {
passport.use('keycloak',
passport.use(conf.key,
new KeycloakStrategy({
authorizationURL: conf.authorizationURL,
userInfoURL: conf.userInfoURL,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/microsoft/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('microsoft',
passport.use(conf.key,
new WindowsLiveStrategy({
clientID: conf.clientId,
clientSecret: conf.clientSecret,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/oauth2/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
done(null, data)
})
}
passport.use('oauth2', client)
passport.use(conf.key, client)
},
logout (conf) {
if (!conf.logoutURL) {
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/oidc/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const OpenIDConnectStrategy = require('passport-openidconnect').Strategy

module.exports = {
init (passport, conf) {
passport.use('oidc',
passport.use(conf.key,
new OpenIDConnectStrategy({
authorizationURL: conf.authorizationURL,
tokenURL: conf.tokenURL,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/okta/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('okta',
passport.use(conf.key,
new OktaStrategy({
audience: conf.audience,
clientID: conf.clientId,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/rocketchat/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = {
})
}

passport.use('rocketchat',
passport.use(conf.key,
new OAuth2Strategy({
authorizationURL: `${siteURL}/oauth/authorize`,
tokenURL: `${siteURL}/oauth/token`,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/saml/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
if (!_.isEmpty(conf.decryptionPvk)) {
samlConfig.decryptionPvk = conf.decryptionPvk
}
passport.use('saml',
passport.use(conf.key,
new SAMLStrategy(samlConfig, async (req, profile, cb) => {
try {
const userId = _.get(profile, [conf.mappingUID], null) || _.get(profile, 'nameID', null)
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/slack/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('slack',
passport.use(conf.key,
new SlackStrategy({
clientID: conf.clientId,
clientSecret: conf.clientSecret,
Expand Down
2 changes: 1 addition & 1 deletion server/modules/authentication/twitch/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const _ = require('lodash')

module.exports = {
init (passport, conf) {
passport.use('twitch',
passport.use(conf.key,
new TwitchStrategy({
clientID: conf.clientId,
clientSecret: conf.clientSecret,
Expand Down

0 comments on commit a652e43

Please sign in to comment.