This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
2020-12-13 14:36:07 +00:00
|
|
|
import * as controller from './controller'
|
|
|
|
import { middleware } from './middleware'
|
|
|
|
import { decision } from './controller/decision'
|
|
|
|
import * as model from './model'
|
2017-08-23 20:13:45 +00:00
|
|
|
|
2020-12-13 14:36:07 +00:00
|
|
|
export class OAuth2Provider {
|
2017-08-23 20:13:45 +00:00
|
|
|
constructor () {
|
|
|
|
this.bearer = middleware
|
|
|
|
this.controller = controller
|
|
|
|
this.decision = decision
|
|
|
|
this.model = model
|
|
|
|
}
|
|
|
|
|
|
|
|
express () {
|
|
|
|
return (req, res, next) => {
|
2017-08-24 13:42:57 +00:00
|
|
|
console.debug('OAuth2 Injected into request')
|
2017-08-23 20:13:45 +00:00
|
|
|
req.oauth2 = this
|
|
|
|
next()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|