Fetch user inside useAuth.

This commit is contained in:
Mike Cao 2022-11-09 06:40:36 -08:00
parent 1bce4f2174
commit 3b705e6cb4
2 changed files with 17 additions and 4 deletions

View file

@ -48,7 +48,11 @@ export function isValidToken(token, validation) {
export async function allowQuery(req, type) {
const { id } = req.query;
const { userId, isAdmin, shareToken } = req.auth ?? {};
const {
user: { id: userId },
isAdmin,
shareToken,
} = req.auth ?? {};
if (isAdmin) {
return true;