Skip to content

Commit 57a5bac

Browse files
committed
🐛 Pick correct sub property
This fixes a bug introduced in 5969d2f. When user logs in for the first time with Entra ID, while previously have used HID, we should find user with that email and update `entraId` property. Also, when they log in for the first time with HID, while previously have used Entra ID, we should update `hidSub` property.
1 parent 6b65dfa commit 57a5bac

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/auth/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,8 @@ export const getLoggedInParticipant = async (
151151
});
152152

153153
if (participant) {
154-
const otherSubProperty = isEntraIDToken ? 'hidSub' : 'entraId';
155-
156154
await models.participant.update({
157-
values: { [otherSubProperty]: sub },
155+
values: { [subProperty]: sub },
158156
where: { id: participant.id },
159157
});
160158
}

0 commit comments

Comments
 (0)