MCPcopy
hub / github.com/mattkrick/meatier / isLoggedIn

Function isLoggedIn

src/server/graphql/models/authorization.js:3–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import {errorObj} from './utils';
2
3export const isLoggedIn = authToken => {
4 if (!authToken || !authToken.id) {
5 throw errorObj({_error: 'Unauthorized'});
6 }
7};
8
9export const isAdminOrSelf = (authToken, {id}) => {
10 const {id: verifiedId, isAdmin} = authToken;

Callers 7

resolveFunction · 0.90
resolveFunction · 0.90
resolveFunction · 0.90
resolveFunction · 0.90
resolveFunction · 0.90
resolveFunction · 0.90
resolveFunction · 0.90

Calls 1

errorObjFunction · 0.90

Tested by

no test coverage detected