change const

This commit is contained in:
Brian Cao 2022-11-01 09:56:43 -07:00
parent 689b732829
commit 075d77abac
3 changed files with 5 additions and 5 deletions

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;

View file

@ -22,7 +22,7 @@ export const REALTIME_RANGE = 30;
export const REALTIME_INTERVAL = 3000;
export const TYPE_WEBSITE = 'website';
export const TYPE_ACCOUNT = 'user';
export const TYPE_USER = 'user';
export const THEME_COLORS = {
light: {