Skip to content

Commit

Permalink
Revert "fix: add role check on checkUserAccess (#133)"
Browse files Browse the repository at this point in the history
This reverts commit b4be44f.
  • Loading branch information
enzomerca committed Apr 24, 2024
1 parent dc0c389 commit 57a2162
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions node/directives/checkUserAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import type { GraphQLField } from 'graphql'
import { defaultFieldResolver } from 'graphql'
import { SchemaDirectiveVisitor } from 'graphql-tools'

import { getActiveUserByEmail } from '../resolvers/Queries/Users'

export async function checkUserOrAdminTokenAccess(
ctx: Context,
operation?: string
Expand Down Expand Up @@ -44,20 +42,6 @@ export async function checkUserOrAdminTokenAccess(
operation,
})
authUser = null
} else {
const user = (await getActiveUserByEmail(
null,
{ email: authUser?.user },
ctx
)) as { roleId: string } | null

if (!user?.roleId) {
logger.warn({
message: `CheckUserAccess: No valid role for user found by store user token`,
operation,
})
authUser = null
}
}
} catch (err) {
logger.warn({
Expand Down

0 comments on commit 57a2162

Please sign in to comment.