mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
use uuid
This commit is contained in:
parent
246e4e5f4f
commit
17041efaae
73 changed files with 491 additions and 874 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { parseSecureToken, parseToken } from 'next-basics';
|
||||
import { getAccount, getWebsite } from 'queries';
|
||||
import { getUser, getWebsite } from 'queries';
|
||||
import { SHARE_TOKEN_HEADER, TYPE_ACCOUNT, TYPE_WEBSITE } from 'lib/constants';
|
||||
import { secret } from 'lib/crypto';
|
||||
|
||||
|
|
@ -50,13 +50,13 @@ export async function allowQuery(req, type) {
|
|||
|
||||
if (userId) {
|
||||
if (type === TYPE_WEBSITE) {
|
||||
const website = await getWebsite({ websiteUuid: id });
|
||||
const website = await getWebsite({ id });
|
||||
|
||||
return website && website.userId === userId;
|
||||
} else if (type === TYPE_ACCOUNT) {
|
||||
const account = await getAccount({ accountUuid: id });
|
||||
const user = await getUser({ id });
|
||||
|
||||
return account && account.accountUuid === id;
|
||||
return user && user.id === id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue