Skip to content

Commit

Permalink
Fix no users being allowed to login when accept_roles set.
Browse files Browse the repository at this point in the history
  • Loading branch information
tech4him1 authored and erquhart committed Nov 11, 2017
1 parent 37a36ff commit 41897de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backends/git-gateway/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export default class GitGateway extends GitHubBackend {
.then((token) => {
let validRole = true;
if (this.accept_roles && this.accept_roles.length > 0) {
const userRoles = get(jwtDecode(token), 'app_metadata.roles', []);
validRole = intersection(userRoles, this.accept_roles).length > 0;
}
const userRoles = get(jwtDecode(token), 'app_metadata.roles', []);
if (validRole) {
const userData = {
name: user.user_metadata.name || user.email.split('@').shift(),
Expand Down

0 comments on commit 41897de

Please sign in to comment.