1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 10:22:39 +01:00

Add logout endpoint

This commit is contained in:
Madeline 2022-09-26 12:42:14 +10:00
parent 14b0c86bcd
commit b85a8bcdfc
No known key found for this signature in database
GPG Key ID: 80D25DA3BCB24281

View File

@ -0,0 +1,16 @@
import { route } from "@fosscord/api";
import { Request, Response, Router } from "express";
const router: Router = Router();
export default router;
router.post("/", route({}), async (req: Request, res: Response) => {
if (req.body.provider != null || req.body.voip_provider != null) {
console.log(`[LOGOUT]: provider or voip provider not null!`, req.body);
} else {
delete req.body.provider;
delete req.body.voip_provider;
if (Object.keys(req.body).length != 0) console.log(`[LOGOUT]: Extra fields sent in logout!`, req.body);
}
res.status(204).send();
});