mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Auth and session middleware.
This commit is contained in:
parent
590a70c2ff
commit
d81ee3932d
14 changed files with 142 additions and 73 deletions
8
lib/auth.js
Normal file
8
lib/auth.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { parse } from 'cookie';
|
||||
import { verifySecureToken } from './crypto';
|
||||
|
||||
export default async req => {
|
||||
const token = parse(req.headers.cookie)['umami.auth'];
|
||||
|
||||
return verifySecureToken(token);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue