mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Fixed dashboard ordering issue. Closes #1414
This commit is contained in:
parent
d4eddaa636
commit
fb39ce8822
4 changed files with 21 additions and 14 deletions
10
lib/auth.js
10
lib/auth.js
|
|
@ -1,5 +1,5 @@
|
|||
import { parseSecureToken, parseToken } from 'next-basics';
|
||||
import { SHARE_TOKEN_HEADER } from './constants';
|
||||
import { parseSecureToken, parseToken, getItem } from 'next-basics';
|
||||
import { AUTH_TOKEN, SHARE_TOKEN_HEADER } from './constants';
|
||||
import { getWebsiteById } from 'queries';
|
||||
import { secret } from './crypto';
|
||||
|
||||
|
|
@ -13,6 +13,12 @@ export async function getAuthToken(req) {
|
|||
}
|
||||
}
|
||||
|
||||
export function getAuthHeader() {
|
||||
const token = getItem(AUTH_TOKEN);
|
||||
|
||||
return token ? { authorization: `Bearer ${token}` } : {};
|
||||
}
|
||||
|
||||
export async function isValidToken(token, validation) {
|
||||
try {
|
||||
const result = parseToken(token, secret());
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
import { getItem } from 'next-basics';
|
||||
import { AUTH_TOKEN } from './constants';
|
||||
|
||||
export function getAuthHeader() {
|
||||
const token = getItem(AUTH_TOKEN);
|
||||
|
||||
return token ? { authorization: `Bearer ${token}` } : {};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue