Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Commit

Permalink
fix : removed every function from route guards
Browse files Browse the repository at this point in the history
  • Loading branch information
mrellipse committed Aug 21, 2018
1 parent 4825515 commit 1670d98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/ui/app/services/authentication/authentication-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { default as Axios, AxiosResponse } from "axios";
import { every } from "lodash/fp";
import { IClaimsHelper } from "./claims-helper";
import { GlobalConfig, PayloadMessageTypes, TokenHelper } from "../../common";
import {
Expand Down Expand Up @@ -49,13 +48,17 @@ export class AuthenticationService extends StoreService
satisfies(user: IUser, claims: string[]): boolean {
if (!user.claims) return false;

return every(o => user["claims"] !== undefined, claims);
var actual = claims.filter(o => user.claims[o] !== undefined).length;

return actual === claims.length;
}

satisfiesAny(user: IUser, claims: string[]): boolean {
if (!user.claims) return false;

return claims.find(o => user["claims"] !== undefined) !== undefined;
var actual = claims.filter(o => user.claims[o] !== undefined).length;

return actual > 0;
}

login(credentials: ICredential) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "toucan.ui",
"version": "3.1.0",
"version": "3.1.1",
"description": "UI project for Toucan template",
"keywords": [
"vuejs",
Expand Down

0 comments on commit 1670d98

Please sign in to comment.