mirror of
https://github.com/status-im/codimd.git
synced 2025-01-11 16:34:33 +00:00
feat: support hostedName in google OAuth 2.0 provider
Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
parent
a6f2ff4aa3
commit
b9f0e37eee
@ -17,7 +17,10 @@ passport.use(new GoogleStrategy({
|
||||
|
||||
googleAuth.get('/auth/google', function (req, res, next) {
|
||||
setReturnToFromReferer(req)
|
||||
passport.authenticate('google', { scope: ['profile'] })(req, res, next)
|
||||
passport.authenticate('google', {
|
||||
scope: ['profile'],
|
||||
hostedDomain: config.google.hostedDomain
|
||||
})(req, res, next)
|
||||
})
|
||||
// google auth callback
|
||||
googleAuth.get('/auth/google/callback',
|
||||
|
@ -133,7 +133,8 @@ module.exports = {
|
||||
},
|
||||
google: {
|
||||
clientID: undefined,
|
||||
clientSecret: undefined
|
||||
clientSecret: undefined,
|
||||
hostedDomain: undefined
|
||||
},
|
||||
ldap: {
|
||||
providerName: undefined,
|
||||
|
@ -105,7 +105,8 @@ module.exports = {
|
||||
},
|
||||
google: {
|
||||
clientID: process.env.CMD_GOOGLE_CLIENTID,
|
||||
clientSecret: process.env.CMD_GOOGLE_CLIENTSECRET
|
||||
clientSecret: process.env.CMD_GOOGLE_CLIENTSECRET,
|
||||
hostedDomain: process.env.CMD_GOOGLE_HOSTEDDOMAIN
|
||||
},
|
||||
ldap: {
|
||||
providerName: process.env.CMD_LDAP_PROVIDERNAME,
|
||||
|
Loading…
x
Reference in New Issue
Block a user