Skip to content

Commit

Permalink
Fixed: user registered roles being reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi committed Dec 4, 2023
1 parent 15ad91b commit 66f4127
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,12 @@ export class ApiService {
authHeader,
);
if (statusFA === FAStatus.USER_EXISTS) {
let registrationId = null;
let registrationId = null, registeredRoles = [];
if (user.registrations) {
user.registrations.map((item) => {
if (item.applicationId == loginDto.applicationId) {
registrationId = item.id;
registeredRoles = item.roles;
}
});
}
Expand All @@ -581,7 +582,7 @@ export class ApiService {
registrations: [
{
applicationId: loginDto.applicationId,
roles: loginDto.roles ?? [],
roles: registeredRoles,
id: registrationId,
},
],
Expand Down

0 comments on commit 66f4127

Please sign in to comment.