Skip to content

Commit

Permalink
Merge pull request #1 from Amruth-Vamshi/dev
Browse files Browse the repository at this point in the history
Fixed: user registered roles being reset.
  • Loading branch information
Amruth-Vamshi authored Dec 6, 2023
2 parents 15ad91b + 66f4127 commit 8362be1
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 8362be1

Please sign in to comment.