umami/lib/auth.js

9 lines
211 B
JavaScript
Raw Normal View History

2020-07-28 08:52:14 +02:00
import { parse } from 'cookie';
import { verifySecureToken } from './crypto';
export default async req => {
2020-07-30 05:09:41 +02:00
const token = parse(req.headers.cookie || '')['umami.auth'];
2020-07-28 08:52:14 +02:00
return verifySecureToken(token);
};