-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathoauth.js
More file actions
22 lines (20 loc) · 784 Bytes
/
oauth.js
File metadata and controls
22 lines (20 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const debug = require('debug')('middleware:oauth');
const OAuthServer = require('express-oauth-server');
const OAuthClient = require('../models/oauth-client');
const oauth = new OAuthServer({
debug: /(oauth)/.test(process.env.DEBUG),
// handleError: errorMiddleware,
useErrorHandler: true,
continueMiddleware: true,
allowBearerTokensInQueryString: false,
addAcceptedScopesHeader: true,
addAuthorizedScopesHeader: true,
model: OAuthClient, // See https://github.com/thomseddon/node-oauth2-server for specification
});
debug('oauth', oauth.server);
// Debug changes in the express-oauth-server implementation
// eslint-disable-next-line no-restricted-syntax, guard-for-in
for (const att in oauth.server) {
debug('oauth server has: ', att);
}
module.exports = oauth;