Skip to content

Commit

Permalink
enable blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Mar 28, 2020
1 parent 5008039 commit fea3841
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/services/current-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export default Service.extend({
// using authenticator:oauth2
let jwt = this.get('session.data.authenticated.access_token');

// rejecting revoked tokens
if (ENV.JWT_BLACKLISTED.split(',').includes(jwt)) {
jwt = null;
this.get('flashMessages').danger('Unable to authenticate because the token has been revoked.');
}
// RSA public key
let cert = ENV.JWT_PUBLIC_KEY ? ENV.JWT_PUBLIC_KEY.replace(/\\n/g, '\n') : null;

Expand Down
1 change: 1 addition & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module.exports = function(environment) {
CLIENT_ADMIN_PASSWORD: process.env.CLIENT_ADMIN_PASSWORD,
VERSION: pkg.version,
APP_NAME: pkg.name,
JWT_BLACKLISTED: process.env.JWT_BLACKLISTED || '',

APP: {
// Here you can pass flags/options to your application instance
Expand Down

0 comments on commit fea3841

Please sign in to comment.