Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fixed issue with realtime page rendering.

* fix auth, add pg extension (umami-software#1596)

* Fixed change password issue. API refactoring. Closes umami-software#1592.

* Fixed account lookup.

* Fixed issue with accessing user dashboards. Closes umami-software#1590

* fix sort on dashboard (umami-software#1600)

Co-authored-by: Brian Cao <brian@umami.is>
  • Loading branch information
2 people authored and dannyhines committed Nov 9, 2022
1 parent a29b9d0 commit e019760
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export async function allowQuery(req, type) {
}

if (userId) {
const website = await getWebsite({ websiteUuid: id });
if (type === TYPE_WEBSITE) {
const website = await getWebsite({ websiteUuid: id });

return website && website.userId === userId;
} else if (type === TYPE_ACCOUNT) {
Expand Down
2 changes: 1 addition & 1 deletion pages/api/websites/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async (req, res) => {
const websites =
isAdmin && include_all
? await getAllWebsites()
: await getUserWebsites({ userId: account?.id });
: await getUserWebsites({ userId: account.id });

return ok(res, websites);
}
Expand Down
2 changes: 1 addition & 1 deletion queries/admin/website/getWebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function getWebsite(where) {
})
.then(async data => {
if (redis.enabled && data) {
await redis.set(`website:${data.websiteUuid}`, data.id);
await redis.client.set(`website:${data.websiteUuid}`, data.id);
}

return data;
Expand Down

0 comments on commit e019760

Please sign in to comment.