umami/pages/api/auth/verify.js

12 lines
209 B
JavaScript
Raw Normal View History

2020-08-05 07:45:05 +02:00
import { useAuth } from 'lib/middleware';
export default async (req, res) => {
await useAuth(req, res);
if (req.auth) {
return res.status(200).json(req.auth);
}
return res.status(401).end();
};