summary refs log tree commit diff
path: root/src/api/routes/auth/mfa/totp.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-01 19:04:22 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-01 19:04:22 +1100
commit13dedb6d251593054de6a64487f0b053060afd5c (patch)
treec829b67068133911cbecdab1057e0d8a0fea09f3 /src/api/routes/auth/mfa/totp.ts
parentgatewayresponse?? (diff)
parentRemove ALL fosscord mentions (diff)
downloadserver-13dedb6d251593054de6a64487f0b053060afd5c.tar.xz
Merge branch 'master' into feat/refactorIdentify
Diffstat (limited to 'src/api/routes/auth/mfa/totp.ts')
-rw-r--r--src/api/routes/auth/mfa/totp.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/api/routes/auth/mfa/totp.ts b/src/api/routes/auth/mfa/totp.ts
index 65cdd397..2396443d 100644
--- a/src/api/routes/auth/mfa/totp.ts
+++ b/src/api/routes/auth/mfa/totp.ts
@@ -1,6 +1,6 @@
 /*
-	Fosscord: A FOSS re-implementation and extension of the Discord.com backend.
-	Copyright (C) 2023 Fosscord and Fosscord Contributors
+	Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
+	Copyright (C) 2023 Spacebar and Spacebar Contributors
 	
 	This program is free software: you can redistribute it and/or modify
 	it under the terms of the GNU Affero General Public License as published
@@ -17,8 +17,8 @@
 */
 
 import { Router, Request, Response } from "express";
-import { route } from "@fosscord/api";
-import { BackupCode, generateToken, User, TotpSchema } from "@fosscord/util";
+import { route } from "@spacebar/api";
+import { BackupCode, generateToken, User, TotpSchema } from "@spacebar/util";
 import { verifyToken } from "node-2fa";
 import { HTTPError } from "lambert-server";
 const router = Router();
@@ -34,7 +34,8 @@ router.post(
 			where: {
 				totp_last_ticket: ticket,
 			},
-			select: ["id", "totp_secret", "settings"],
+			select: ["id", "totp_secret"],
+			relations: ["settings"],
 		});
 
 		const backup = await BackupCode.findOne({
@@ -62,7 +63,7 @@ router.post(
 
 		return res.json({
 			token: await generateToken(user.id),
-			user_settings: user.settings,
+			settings: { ...user.settings, index: undefined },
 		});
 	},
 );