feat: auth0 + discord + github + slack auth modules
This commit is contained in:
34
server/modules/authentication/firebase/authentication.js
Normal file
34
server/modules/authentication/firebase/authentication.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* global WIKI */
|
||||
|
||||
// ------------------------------------
|
||||
// GitHub Account
|
||||
// ------------------------------------
|
||||
|
||||
const GitHubStrategy = require('passport-github2').Strategy
|
||||
const _ = require('lodash')
|
||||
|
||||
module.exports = {
|
||||
init (passport, conf) {
|
||||
passport.use('github',
|
||||
new GitHubStrategy({
|
||||
clientID: conf.clientId,
|
||||
clientSecret: conf.clientSecret,
|
||||
callbackURL: conf.callbackURL,
|
||||
scope: ['user:email']
|
||||
}, async (accessToken, refreshToken, profile, cb) => {
|
||||
try {
|
||||
const user = await WIKI.models.users.processProfile({
|
||||
profile: {
|
||||
...profile,
|
||||
picture: _.get(profile, 'photos[0].value', '')
|
||||
},
|
||||
providerKey: 'github'
|
||||
})
|
||||
cb(null, user)
|
||||
} catch (err) {
|
||||
cb(err, null)
|
||||
}
|
||||
}
|
||||
))
|
||||
}
|
||||
}
|
11
server/modules/authentication/firebase/definition.yml
Normal file
11
server/modules/authentication/firebase/definition.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
key: firebase
|
||||
title: Firebase
|
||||
description: Firebase is Google's mobile platform that helps you quickly develop high-quality apps and grow your business.
|
||||
author: requarks.io
|
||||
logo: https://static.requarks.io/logo/firebase.svg
|
||||
color: yellow darken-3
|
||||
website: https://firebase.google.com/
|
||||
isAvailable: false
|
||||
useForm: false
|
||||
props: {}
|
||||
|
Reference in New Issue
Block a user