mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 18:26:32 -05:00
fixed google
Signed-off-by: Yannick Bungers <git@innay.de> Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
83ef1de792
commit
992affae45
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
import { Router } from 'express'
|
import { Router } from 'express'
|
||||||
import { AuthMiddleware } from '../interface'
|
import { AuthMiddleware } from '../interface'
|
||||||
import passport from 'passport'
|
import passport from 'passport'
|
||||||
import * as GoogleStrategy from 'passport-google-oauth20'
|
import * as Google from 'passport-google-oauth20'
|
||||||
import {config} from '../../../config'
|
import {config} from '../../../config'
|
||||||
import { passportGeneralCallback } from '../utils'
|
import { passportGeneralCallback } from '../utils'
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ const googleAuth = Router()
|
||||||
|
|
||||||
export const GoogleMiddleware: AuthMiddleware = {
|
export const GoogleMiddleware: AuthMiddleware = {
|
||||||
getMiddleware (): Router {
|
getMiddleware (): Router {
|
||||||
passport.use(new GoogleStrategy({
|
passport.use(new Google.Strategy({
|
||||||
clientID: config.google.clientID,
|
clientID: config.google.clientID,
|
||||||
clientSecret: config.google.clientSecret,
|
clientSecret: config.google.clientSecret,
|
||||||
callbackURL: config.serverURL + '/auth/google/callback',
|
callbackURL: config.serverURL + '/auth/google/callback',
|
||||||
|
@ -17,7 +17,7 @@ export const GoogleMiddleware: AuthMiddleware = {
|
||||||
}, passportGeneralCallback))
|
}, passportGeneralCallback))
|
||||||
|
|
||||||
googleAuth.get('/auth/google', function (req, res, next) {
|
googleAuth.get('/auth/google', function (req, res, next) {
|
||||||
const authOpts: GoogleStrategy.AuthtenticateOptionsGoogle = { scope: ['profile'], hostedDomain: config.google.hostedDomain }
|
const authOpts = { scope: ['profile'], hostedDomain: config.google.hostedDomain }
|
||||||
passport.authenticate('google', authOpts)(req, res, next)
|
passport.authenticate('google', authOpts)(req, res, next)
|
||||||
})
|
})
|
||||||
googleAuth.get('/auth/google/callback',
|
googleAuth.get('/auth/google/callback',
|
||||||
|
|
Loading…
Reference in a new issue