summary refs log tree commit diff
path: root/src/api/routes/auth/logout.ts
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-09-17 19:38:54 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-09-17 19:38:54 +0200
commit15b79052c88ce30a713c6f942cedf01211b50a5f (patch)
treecc444dce096a314e7fa2700a07858039d7ee8a61 /src/api/routes/auth/logout.ts
parentAdd register ratelimit (diff)
downloadserver-15b79052c88ce30a713c6f942cedf01211b50a5f.tar.xz
Partially refactor code to use localization
Diffstat (limited to 'src/api/routes/auth/logout.ts')
-rw-r--r--src/api/routes/auth/logout.ts19
1 files changed, 19 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..b54be044
--- /dev/null
+++ b/src/api/routes/auth/logout.ts
@@ -0,0 +1,19 @@
+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