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",
|
"id",
|
||||||
"disabled",
|
"disabled",
|
||||||
"deleted",
|
"deleted",
|
||||||
"settings",
|
|
||||||
"totp_secret",
|
"totp_secret",
|
||||||
"mfa_enabled",
|
"mfa_enabled",
|
||||||
"webauthn_enabled",
|
"webauthn_enabled",
|
||||||
"security_keys",
|
"security_keys",
|
||||||
"verified",
|
"verified",
|
||||||
],
|
],
|
||||||
relations: ["security_keys"],
|
relations: ["security_keys", "settings"],
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
throw FieldErrors({
|
throw FieldErrors({
|
||||||
login: {
|
login: {
|
||||||
@ -187,7 +186,7 @@ router.post(
|
|||||||
// Discord header is just the user id as string, which is not possible with npm-jsonwebtoken package
|
// 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
|
// 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: {
|
where: {
|
||||||
totp_last_ticket: ticket,
|
totp_last_ticket: ticket,
|
||||||
},
|
},
|
||||||
select: ["id", "totp_secret", "settings"],
|
select: ["id", "totp_secret"],
|
||||||
|
relations: ["settings"],
|
||||||
});
|
});
|
||||||
|
|
||||||
const backup = await BackupCode.findOne({
|
const backup = await BackupCode.findOne({
|
||||||
|
@ -54,7 +54,8 @@ router.post(
|
|||||||
where: {
|
where: {
|
||||||
totp_last_ticket: ticket,
|
totp_last_ticket: ticket,
|
||||||
},
|
},
|
||||||
select: ["id", "settings"],
|
select: ["id"],
|
||||||
|
relations: ["settings"],
|
||||||
});
|
});
|
||||||
|
|
||||||
const ret = await verifyWebAuthnToken(ticket);
|
const ret = await verifyWebAuthnToken(ticket);
|
||||||
|
@ -89,11 +89,11 @@ router.post(
|
|||||||
"id",
|
"id",
|
||||||
"disabled",
|
"disabled",
|
||||||
"deleted",
|
"deleted",
|
||||||
"settings",
|
|
||||||
"totp_secret",
|
"totp_secret",
|
||||||
"mfa_enabled",
|
"mfa_enabled",
|
||||||
"username",
|
"username",
|
||||||
],
|
],
|
||||||
|
relations: ["settings"],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isGenerateSchema(req.body)) {
|
if (isGenerateSchema(req.body)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user