mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Feat/um 62 prisma property names (#1562)
* checkpoint * fix pg schema * fix mysql schema * change property names
This commit is contained in:
parent
36edbe2f4c
commit
78338205a3
65 changed files with 431 additions and 433 deletions
|
|
@ -40,19 +40,19 @@ export async function allowQuery(req, skipToken) {
|
|||
const { id } = req.query;
|
||||
const token = req.headers[SHARE_TOKEN_HEADER];
|
||||
|
||||
const website = await getWebsite(validate(id) ? { website_uuid: id } : { website_id: +id });
|
||||
const website = await getWebsite(validate(id) ? { websiteUuid: id } : { id: +id });
|
||||
|
||||
if (website) {
|
||||
if (token && token !== 'undefined' && !skipToken) {
|
||||
return isValidToken(token, { website_id: website.website_id });
|
||||
return isValidToken(token, { websiteId: website.id });
|
||||
}
|
||||
|
||||
const authToken = await getAuthToken(req);
|
||||
|
||||
if (authToken) {
|
||||
const { user_id, is_admin } = authToken;
|
||||
const { userId, isAdmin } = authToken;
|
||||
|
||||
return is_admin || website.user_id === user_id;
|
||||
return isAdmin || website.userId === userId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue