mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-22 18:32:29 +01:00
Add logout endpoint
This commit is contained in:
parent
14b0c86bcd
commit
b85a8bcdfc
16
src/api/routes/auth/logout.ts
Normal file
16
src/api/routes/auth/logout.ts
Normal 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();
|
||||
});
|
Loading…
Reference in New Issue
Block a user