diff options
Diffstat (limited to 'src/api/routes/auth/login.ts')
-rw-r--r-- | src/api/routes/auth/login.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts index e6616731..fe0b4f99 100644 --- a/src/api/routes/auth/login.ts +++ b/src/api/routes/auth/login.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 @@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; +import { getIpAdress, route, verifyCaptcha } from "@spacebar/api"; import { adjustEmail, Config, @@ -26,7 +26,7 @@ import { LoginSchema, User, WebAuthn, -} from "@fosscord/util"; +} from "@spacebar/util"; import bcrypt from "bcrypt"; import crypto from "crypto"; import { Request, Response, Router } from "express"; @@ -72,14 +72,13 @@ router.post( "id", "disabled", "deleted", - "settings", "totp_secret", "mfa_enabled", "webauthn_enabled", "security_keys", "verified", ], - relations: ["security_keys"], + relations: ["security_keys", "settings"], }).catch(() => { throw FieldErrors({ login: { @@ -187,7 +186,7 @@ router.post( // Discord header is just the user id as string, which is not possible with npm-jsonwebtoken package // https://user-images.githubusercontent.com/6506416/81051916-dd8c9900-8ec2-11ea-8794-daf12d6f31f0.png - res.json({ token, settings: user.settings }); + res.json({ token, settings: { ...user.settings, index: undefined } }); }, ); |