mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Fetch user inside useAuth.
This commit is contained in:
parent
1bce4f2174
commit
3b705e6cb4
2 changed files with 17 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue