Fix no users being allowed to login when accept_roles set.

This commit is contained in:
Caleb 2017-11-10 16:33:22 -07:00 committed by Shawn Erquhart
parent 37a36ffed4
commit 41897de4c9

View File

@ -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(),