Guarantee req.oauth in APIRoute middleware
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

master ci-03
Garrett Mills 4 years ago
parent ce7349565e
commit efdea10b14
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

@ -10,6 +10,7 @@ class APIRouteMiddleware extends Middleware {
if ( allow_user && req.is_auth ) {
return next()
} else if ( allow_token ) {
if ( !req.oauth ) req.oauth = {}
return req.app.oauth2.authorise()(req, res, async e => {
if ( e ) return next(e)
// Look up the OAuth2 client an inject it into the route

Loading…
Cancel
Save