fix: correct Sequelize alias case for OIDCIdentity-User association (#1015)
* fix: use nullish coalescing for recurrence weekday to allow Sunday selection Fixes #812 When creating a "Monthly on weekday" recurring task, the selector would jump back to Monday when trying to select Sunday. This was caused by using the logical OR operator (||) instead of the nullish coalescing operator (??) when handling the recurrence_weekday value. Since Sunday is represented as 0, the || operator treated it as falsy and defaulted to null/undefined, which then defaulted to 1 (Monday). Changes: - Replace || with ?? for recurrence_weekday in TaskRecurrenceCard.tsx - Replace || with ?? for recurrence_weekday in TaskDetails.tsx - Also fix recurrence_week_of_month and recurrence_month_day for consistency * fix: correct Sequelize alias case for OIDCIdentity-User association Fixes #1013 Changed all instances of lowercase 'user' to 'User' to match the association defined in models/index.js. This resolves the Sequelize error during OIDC callback: "User is associated to OIDCIdentity using an alias. You've included an alias (user), but it does not match the alias(es) defined in your association (User)." Changes: - oidcIdentityService.js: 'user' -> 'User' - provisioningService.js: 'user' -> 'User' (2 instances)
This commit is contained in:
parent
733b6cd14b
commit
34dc0373fb
2 changed files with 3 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ async function getIdentityById(identityId) {
|
|||
include: [
|
||||
{
|
||||
model: User,
|
||||
as: 'user',
|
||||
as: 'User',
|
||||
attributes: ['id', 'email', 'username', 'is_admin'],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ async function findOrCreateIdentity(providerSlug, claims) {
|
|||
provider_slug: providerSlug,
|
||||
subject: claims.sub,
|
||||
},
|
||||
include: [{ model: User, as: 'user' }],
|
||||
include: [{ model: User, as: 'User' }],
|
||||
});
|
||||
|
||||
return identity;
|
||||
|
|
@ -42,7 +42,7 @@ async function provisionUser(providerSlug, claims, req) {
|
|||
provider_slug: providerSlug,
|
||||
subject: claims.sub,
|
||||
},
|
||||
include: [{ model: User, as: 'user' }],
|
||||
include: [{ model: User, as: 'User' }],
|
||||
transaction,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue