Skip to content

Commit

Permalink
BAH-3971 | Add. Null Check For LocationCookieName Assignment (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahu1ramesh authored Jul 19, 2024
1 parent 08763be commit d2650be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/app/common/auth/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ angular.module('authentication')
userService.getProviderForUser(data.results[0].uuid).then(function (providers) {
if (!_.isEmpty(providers.results) && hasAnyActiveProvider(providers.results)) {
$rootScope.currentUser = new Bahmni.Auth.User(data.results[0]);
$rootScope.currentUser.currentLocation = $bahmniCookieStore.get(Bahmni.Common.Constants.locationCookieName).name;
var location = $bahmniCookieStore.get(Bahmni.Common.Constants.locationCookieName);
if (location) {
$rootScope.currentUser.currentLocation = location.name;
}
$rootScope.$broadcast('event:user-credentialsLoaded', data.results[0]);
deferrable.resolve(data.results[0]);
} else {
Expand Down

0 comments on commit d2650be

Please sign in to comment.