mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Updated share token logic. Closes #1113.
This commit is contained in:
parent
b5de6b997e
commit
e735a1c50d
12 changed files with 44 additions and 42 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { parseSecureToken, parseToken } from './crypto';
|
||||
import { TOKEN_HEADER } from './constants';
|
||||
import { SHARE_TOKEN_HEADER } from './constants';
|
||||
import { getWebsiteById } from './queries';
|
||||
|
||||
export async function getAuthToken(req) {
|
||||
|
|
@ -30,7 +30,7 @@ export async function isValidToken(token, validation) {
|
|||
|
||||
export async function allowQuery(req, skipToken) {
|
||||
const { id } = req.query;
|
||||
const token = req.headers[TOKEN_HEADER];
|
||||
const token = req.headers[SHARE_TOKEN_HEADER];
|
||||
const websiteId = +id;
|
||||
|
||||
const website = await getWebsiteById(websiteId);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export const DATE_RANGE_CONFIG = 'umami.date-range';
|
|||
export const THEME_CONFIG = 'umami.theme';
|
||||
export const DASHBOARD_CONFIG = 'umami.dashboard';
|
||||
export const VERSION_CHECK = 'umami.version-check';
|
||||
export const TOKEN_HEADER = 'x-umami-token';
|
||||
export const SHARE_TOKEN_HEADER = 'x-umami-share-token';
|
||||
export const HOMEPAGE_URL = 'https://umami.is';
|
||||
export const VERSION_URL = 'https://github.com/mikecao/umami/releases';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue