22 lines
485 B
JavaScript
22 lines
485 B
JavaScript
import * as controller from './controller'
|
|
import { middleware } from './middleware'
|
|
import { decision } from './controller/decision'
|
|
import * as model from './model'
|
|
|
|
export class OAuth2Provider {
|
|
constructor () {
|
|
this.bearer = middleware
|
|
this.controller = controller
|
|
this.decision = decision
|
|
this.model = model
|
|
}
|
|
|
|
express () {
|
|
return (req, res, next) => {
|
|
console.debug('OAuth2 Injected into request')
|
|
req.oauth2 = this
|
|
next()
|
|
}
|
|
}
|
|
}
|