umami/pages/api/verify.js
2020-07-23 19:56:55 -07:00

13 lines
258 B
JavaScript

import { verifySecureToken } from 'lib/crypto';
export default async (req, res) => {
const { token } = req.body;
try {
const payload = await verifySecureToken(token);
res.status(200).send(payload);
} catch {
res.status(400).end();
}
};