mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 01:35:17 +01:00
14 lines
298 B
JavaScript
14 lines
298 B
JavaScript
import { parseSecureToken } from 'lib/crypto';
|
|
import { ok, badRequest } from 'lib/response';
|
|
|
|
export default async (req, res) => {
|
|
const { token } = req.body;
|
|
|
|
try {
|
|
const payload = await parseSecureToken(token);
|
|
return ok(res, payload);
|
|
} catch {
|
|
return badRequest(res);
|
|
}
|
|
};
|