change const

This commit is contained in:
Brian Cao committed 2022-11-01 09:56:43 -07:00
1 parent 689b732829
commit 075d77abac
3 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
import { parseSecureToken, parseToken } from 'next-basics';
import { getUser, getWebsite } from 'queries';
import debug from 'debug';
import { SHARE_TOKEN_HEADER, TYPE_ACCOUNT, TYPE_WEBSITE } from 'lib/constants';
import { SHARE_TOKEN_HEADER, TYPE_USER, TYPE_WEBSITE } from 'lib/constants';
import { secret } from 'lib/crypto';
const log = debug('umami:auth');
@@ -58,7 +58,7 @@ export async function allowQuery(req, type) {
const website = await getWebsite({ id });
return website && website.userId === userId;
} else if (type === TYPE_ACCOUNT) {
} else if (type === TYPE_USER) {
const user = await getUser({ id });
return user && user.id === id;