1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-26 04:03:03 +01:00

Fix UserSettings relation being in select rather than relations

This commit is contained in:
Madeline 2023-03-16 11:31:24 +11:00
parent bd5f750024
commit 4d06b86d7b
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
4 changed files with 7 additions and 6 deletions

View File

@ -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 } });
},
);

View File

@ -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({

View File

@ -54,7 +54,8 @@ router.post(
where: {
totp_last_ticket: ticket,
},
select: ["id", "settings"],
select: ["id"],
relations: ["settings"],
});
const ret = await verifyWebAuthnToken(ticket);

View File

@ -89,11 +89,11 @@ router.post(
"id",
"disabled",
"deleted",
"settings",
"totp_secret",
"mfa_enabled",
"username",
],
relations: ["settings"],
});
if (isGenerateSchema(req.body)) {