Skip to content

Commit

Permalink
Merge pull request #19 from Asymmetrik/fix/sanitize-oauth
Browse files Browse the repository at this point in the history
Add sanitize to auth routes
  • Loading branch information
jonterrylee authored May 7, 2018
2 parents 6cb4f90 + a57cbd8 commit 9a154dd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
26 changes: 24 additions & 2 deletions src/server/oauth/oauth.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,39 @@ let routes = [
name: 'aud',
type: 'string',
required: true
},
{
name: 'launch',
type: 'string'
}],
scopes: [{
name: 'code',
type: 'string'
}],
},
],
controller: controller.authorize
},
{
type: 'post',
path: '/token',
args: [],
args: [{
name: 'grant_type',
type: 'string',
required: true
},
{
name: 'code',
type: 'string',
required: true
},
{
name: 'secret',
type: 'string'
},
{
name: 'refresh_token',
type: 'string'
}],
scopes: [],
controller: controller.token
}
Expand Down
5 changes: 4 additions & 1 deletion src/server/oauth/routes/oauth.routes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const cors = require('cors');
const { routes } = require('../oauth.config');
const { sanitizeMiddleware } = require('../../utils/sanitize.utils');


/**
* @name exports
Expand All @@ -25,9 +27,10 @@ module.exports = (app, config, logger) => {
app[route.type](
route.path,
cors(corsOptions),
sanitizeMiddleware(route.args),
route.controller(oauth, config, logger)
);
});
}

};
};

0 comments on commit 9a154dd

Please sign in to comment.