mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Refactor authentication and token handling.
This commit is contained in:
parent
1a8c7c42f4
commit
67732b9b5a
7 changed files with 50 additions and 70 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { getRandomChars, parseSecureToken, parseToken } from 'next-basics';
|
||||
import { parseSecureToken, parseToken } from 'next-basics';
|
||||
import { getUser, getWebsite } from 'queries';
|
||||
import debug from 'debug';
|
||||
import { SHARE_TOKEN_HEADER, TYPE_USER, TYPE_WEBSITE } from 'lib/constants';
|
||||
|
|
@ -6,10 +6,6 @@ import { secret } from 'lib/crypto';
|
|||
|
||||
const log = debug('umami:auth');
|
||||
|
||||
export function generateAuthToken() {
|
||||
return `auth:${getRandomChars(32)}`;
|
||||
}
|
||||
|
||||
export function getAuthToken(req) {
|
||||
const token = req.headers.authorization;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue