Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 8x 8x 8x 8x 8x 1x | import passport from 'passport'
import { Strategy } from 'passport-google-oauth20'
import { Commun } from '@commun/core'
import { ExternalAuth } from './ExternalAuth'
export const GoogleAuthStrategy = {
registerStrategy () {
passport.use(new Strategy({
clientID: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
callbackURL: `${Commun.getOptions().endpoint}/api/v1/auth/google/callback`
}, async (...args) => {
await ExternalAuth.authCallback('google', ...args)
})
)
},
authOptions: {
scope: ['profile', 'email']
},
}
|