summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 12:42:14 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 12:42:14 +1000
commitb85a8bcdfc5c3d029906b60738498c60ed521c26 (patch)
tree61b57b8c872ed6d9a2d01a024716b6fc24cc51dc
parent'Fix' distinct alias typeorm issue (diff)
downloadserver-b85a8bcdfc5c3d029906b60738498c60ed521c26.tar.xz
Add logout endpoint
-rw-r--r--src/api/routes/auth/logout.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/api/routes/auth/logout.ts b/src/api/routes/auth/logout.ts
new file mode 100644
index 00000000..e806fed9
--- /dev/null
+++ b/src/api/routes/auth/logout.ts
@@ -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();
+});
\ No newline at end of file