mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Handle website delete. Added response helper functions.
This commit is contained in:
parent
0a411a9ad6
commit
c4b75e4aec
31 changed files with 314 additions and 96 deletions
|
|
@ -1,12 +1,13 @@
|
|||
import { verifySecureToken } from 'lib/crypto';
|
||||
import { parseSecureToken } from 'lib/crypto';
|
||||
import { ok, badRequest } from 'lib/response';
|
||||
|
||||
export default async (req, res) => {
|
||||
const { token } = req.body;
|
||||
|
||||
try {
|
||||
const payload = await verifySecureToken(token);
|
||||
return res.status(200).json(payload);
|
||||
const payload = await parseSecureToken(token);
|
||||
return ok(res, payload);
|
||||
} catch {
|
||||
return res.status(400).end();
|
||||
return badRequest(res);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue