Fetch user inside useAuth.
This commit is contained in:
1 parent
1bce4f2174
commit
3b705e6cb4
2 files changed
+17
-4
No files matched your search
+5
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user