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:
parent
bd5f750024
commit
4d06b86d7b
@ -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 } });
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -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({
|
||||
|
@ -54,7 +54,8 @@ router.post(
|
||||
where: {
|
||||
totp_last_ticket: ticket,
|
||||
},
|
||||
select: ["id", "settings"],
|
||||
select: ["id"],
|
||||
relations: ["settings"],
|
||||
});
|
||||
|
||||
const ret = await verifyWebAuthnToken(ticket);
|
||||
|
@ -89,11 +89,11 @@ router.post(
|
||||
"id",
|
||||
"disabled",
|
||||
"deleted",
|
||||
"settings",
|
||||
"totp_secret",
|
||||
"mfa_enabled",
|
||||
"username",
|
||||
],
|
||||
relations: ["settings"],
|
||||
});
|
||||
|
||||
if (isGenerateSchema(req.body)) {
|
||||
|
Loading…
Reference in New Issue
Block a user