Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #22 from RodolfoSilva/hotfix/add-async-check
Browse files Browse the repository at this point in the history
fix: allow async check
  • Loading branch information
RodolfoSilva authored Jul 24, 2020
2 parents 02e9493 + 149a68e commit 0bee9a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ const checkUserCanDoRegistration = (req: Request): boolean => {
return true;
};

const checkUserIsPartOfStaffOrIsTheCurrentUser = (
const checkUserIsPartOfStaffOrIsTheCurrentUser = async (
req: Request,
user: User,
): boolean => {
): Promise<boolean> => {
if (isAdmin(req)) {
return true;
}
Expand All @@ -84,7 +84,7 @@ const checkUserIsPartOfStaffOrIsTheCurrentUser = (

if (
getIntersection(roles, ['admin']).length >= 1 ||
isUserAllowedToChangePassword(currentUserId, user, req)
(await isUserAllowedToChangePassword(currentUserId, user, req))
) {
return true;
}
Expand Down

0 comments on commit 0bee9a2

Please sign in to comment.