Skip to content

Commit

Permalink
Merge pull request #72 from samagra-comms/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
chinmoy12c authored Jan 19, 2024
2 parents 04eac68 + bb361b3 commit f73f80d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
</parent>
<groupId>com.uci</groupId>
<artifactId>orchestrator</artifactId>
<version>2.4.1</version>
<version>2.4.2</version>
<name>orchestrator</name>
<description>Demo project for Spring Boot</description>

<properties>
<java.version>11</java.version>
<utils.version>2.4.0</utils.version>
<messagerosa.version>2.4.0</messagerosa.version>
<dao.version>2.4.0</dao.version>
<utils.version>2.4.1</utils.version>
<messagerosa.version>2.4.1</messagerosa.version>
<dao.version>2.4.1</dao.version>
</properties>

<!-- For Downloading repositories from github packages -->
Expand Down
19 changes: 16 additions & 3 deletions src/main/java/com/uci/orchestrator/Service/CommonService.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,14 @@ public Mono<XMessage> apply(Pair<Boolean, String> result) {
from.setEncryptedDeviceID(deviceID);
xmsg.setFrom(from);
ClientResponse<UserResponse, Errors> response = botService.fusionAuthClient.retrieveUserByUsername(deviceID);
if (response.wasSuccessful() && isUserRegistered(response, appID)) {
boolean wasSuccessful = response.wasSuccessful();
boolean isUserRegistered = false;
if (wasSuccessful) {
isUserRegistered = isUserRegistered(response, appID);
}
log.info("CommonService::UpdateUser: response.wasSuccessful: " + wasSuccessful);
log.info("CommonService::UpdateUser: isUserRegistered: " + isUserRegistered);
if (wasSuccessful && isUserRegistered) {
redisCacheService.setFAUserIDForAppCache(getFACacheName(deviceID, appID), response.successResponse.user.id.toString());
return Mono.just(xmsg);
} else {
Expand Down Expand Up @@ -384,8 +391,14 @@ private String getFAUserIdForApp(String deviceID, UUID appID) {

if (userID == null || userID.isEmpty()) {
ClientResponse<UserResponse, Errors> response = botService.fusionAuthClient.retrieveUserByUsername(deviceID);

if (response.wasSuccessful() && isUserRegistered(response, appID)) {
boolean wasSuccessful = response.wasSuccessful();
boolean isUserRegistered = false;
if (wasSuccessful) {
wasSuccessful = isUserRegistered(response, appID);
}
log.info("CommonService::UpdateUser: response.wasSuccessful: " + wasSuccessful);
log.info("CommonService::UpdateUser: isUserRegistered: " + isUserRegistered);
if (wasSuccessful && isUserRegistered) {
userID = response.successResponse.user.id.toString();
redisCacheService.setFAUserIDForAppCache(getFACacheName(deviceID, appID), userID);
}
Expand Down

0 comments on commit f73f80d

Please sign in to comment.