Fetch user inside useAuth.

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

No files matched your search

+5 -1
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;