umami/pages/api/verify.js

13 lines
272 B
JavaScript
Raw Normal View History

2020-07-23 06:33:17 +02:00
import { verifySecureToken } from 'lib/crypto';
export default async (req, res) => {
const { token } = req.body;
try {
const payload = await verifySecureToken(token);
return res.status(200).json(payload);
2020-07-23 06:33:17 +02:00
} catch {
return res.status(400).end();
2020-07-23 06:33:17 +02:00
}
};