mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 11:15:23 -04:00
auth/index.ts: Refactor Gitlab & Dropbox middlewares
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
1353e61e87
commit
1903ba12af
2 changed files with 8 additions and 9 deletions
|
@ -1,13 +1,13 @@
|
|||
import { NextFunction, Request, Response, Router } from 'express'
|
||||
import passport from 'passport'
|
||||
import { config } from '../../../config'
|
||||
import { passportGeneralCallback } from '../utils'
|
||||
import { Router, Response, NextFunction, Request } from 'express'
|
||||
import * as DropboxStrategy from 'passport-dropbox-oauth2'
|
||||
import { config } from '../../../config'
|
||||
import { AuthMiddleware } from '../interface'
|
||||
import { passportGeneralCallback } from '../utils'
|
||||
|
||||
export const dropboxAuth = Router()
|
||||
|
||||
export const EmailMiddleware: AuthMiddleware = {
|
||||
export const DropboxMiddleware: AuthMiddleware = {
|
||||
getMiddleware (): Router {
|
||||
passport.use(new DropboxStrategy({
|
||||
apiVersion: '2',
|
||||
|
@ -27,5 +27,4 @@ export const EmailMiddleware: AuthMiddleware = {
|
|||
)
|
||||
return dropboxAuth
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue