umami/lib/auth.js
2020-07-27 23:52:14 -07:00

9 lines
205 B
JavaScript

import { parse } from 'cookie';
import { verifySecureToken } from './crypto';
export default async req => {
const token = parse(req.headers.cookie)['umami.auth'];
return verifySecureToken(token);
};