mirror of https://github.com/Requarks/wiki.git
NGPixel
7 years ago
15 changed files with 164 additions and 24 deletions
Split View
Diff Options
-
7client/js/components/login.vue
-
24client/js/components/navigator.vue
-
4client/scss/components/login.scss
-
21client/svg/icons.svg
-
3package.json
-
30server/extensions/authentication/auth0.js
-
2server/extensions/authentication/azure.js
-
30server/extensions/authentication/discord.js
-
2server/extensions/authentication/facebook.js
-
2server/extensions/authentication/github.js
-
2server/extensions/authentication/google.js
-
2server/extensions/authentication/microsoft.js
-
2server/extensions/authentication/slack.js
-
30server/extensions/authentication/twitch.js
-
27yarn.lock
@ -0,0 +1,30 @@ |
|||
/* global wiki */ |
|||
|
|||
// ------------------------------------
|
|||
// Auth0 Account
|
|||
// ------------------------------------
|
|||
|
|||
const Auth0Strategy = require('passport-auth0').Strategy |
|||
|
|||
module.exports = { |
|||
key: 'auth0', |
|||
title: 'Auth0', |
|||
useForm: false, |
|||
props: ['domain', 'clientId', 'clientSecret'], |
|||
init (passport, conf) { |
|||
passport.use('auth0', |
|||
new Auth0Strategy({ |
|||
domain: conf.domain, |
|||
clientID: conf.clientId, |
|||
clientSecret: conf.clientSecret, |
|||
callbackURL: conf.callbackURL |
|||
}, function (accessToken, refreshToken, profile, cb) { |
|||
wiki.db.User.processProfile(profile).then((user) => { |
|||
return cb(null, user) || true |
|||
}).catch((err) => { |
|||
return cb(err, null) || true |
|||
}) |
|||
} |
|||
)) |
|||
} |
|||
} |
@ -0,0 +1,30 @@ |
|||
/* global wiki */ |
|||
|
|||
// ------------------------------------
|
|||
// Discord Account
|
|||
// ------------------------------------
|
|||
|
|||
const DiscordStrategy = require('passport-discord').Strategy |
|||
|
|||
module.exports = { |
|||
key: 'discord', |
|||
title: 'Discord', |
|||
useForm: false, |
|||
props: ['clientId', 'clientSecret'], |
|||
init (passport, conf) { |
|||
passport.use('discord', |
|||
new DiscordStrategy({ |
|||
clientID: conf.clientId, |
|||
clientSecret: conf.clientSecret, |
|||
callbackURL: conf.callbackURL, |
|||
scope: 'identify email' |
|||
}, function (accessToken, refreshToken, profile, cb) { |
|||
wiki.db.User.processProfile(profile).then((user) => { |
|||
return cb(null, user) || true |
|||
}).catch((err) => { |
|||
return cb(err, null) || true |
|||
}) |
|||
} |
|||
)) |
|||
} |
|||
} |
@ -0,0 +1,30 @@ |
|||
/* global wiki */ |
|||
|
|||
// ------------------------------------
|
|||
// Twitch Account
|
|||
// ------------------------------------
|
|||
|
|||
const TwitchStrategy = require('passport-twitch').Strategy |
|||
|
|||
module.exports = { |
|||
key: 'twitch', |
|||
title: 'Twitch', |
|||
useForm: false, |
|||
props: ['clientId', 'clientSecret'], |
|||
init (passport, conf) { |
|||
passport.use('twitch', |
|||
new TwitchStrategy({ |
|||
clientID: conf.clientId, |
|||
clientSecret: conf.clientSecret, |
|||
callbackURL: conf.callbackURL, |
|||
scope: 'user_read' |
|||
}, function (accessToken, refreshToken, profile, cb) { |
|||
wiki.db.User.processProfile(profile).then((user) => { |
|||
return cb(null, user) || true |
|||
}).catch((err) => { |
|||
return cb(err, null) || true |
|||
}) |
|||
} |
|||
)) |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save