summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBloom Sirenix <66263341+bloomsirenix@users.noreply.github.com>2021-05-22 22:55:52 +0200
committerBloom Sirenix <66263341+bloomsirenix@users.noreply.github.com>2021-05-22 22:55:52 +0200
commitd7d88682824e69a740fe5e81270d2757b4554f74 (patch)
tree02df59acc7b22ec1336d44c682e3e768bcb7ec3c /src
parentMerge branch 'master' of https://github.com/bloomsirenix/fosscord-api (diff)
downloadserver-d7d88682824e69a740fe5e81270d2757b4554f74.tar.xz
Made Delete request easier for users
less of an pain
Diffstat (limited to 'src')
-rw-r--r--src/routes/users/@me/delete.ts10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/routes/users/@me/delete.ts b/src/routes/users/@me/delete.ts
index 68dbf0ae..8341a746 100644
--- a/src/routes/users/@me/delete.ts
+++ b/src/routes/users/@me/delete.ts
@@ -9,15 +9,9 @@ const router = Router();
 
 router.post("/", async (req: Request, res: Response) => {
 	// TODO:
-	const { authorization } = req.headers;
  //console.log(req.headers);
-	console.log(authorization);
-	var auth = ""+ authorization;
-	let u = JSON.parse(atob(auth.split(".")[1]))
-	var userid = u.id;
-	console.log(userid);
-	const user = await getPublicUser(userid);
-	await UserModel.remove(user).exec();
+ await UserModel.deleteOne({id: req.user_id}).exec()
+	
 	//await usermodel.save();
 
 	res.sendStatus(204);