Skip to content

Commit

Permalink
add Added Last Login Date Update
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenferey committed Nov 8, 2023
1 parent 7a15b57 commit 10ceddd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/edu/harvard/iq/dataverse/Shib.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ else if (ShibAffiliationOrder.equals("firstAffiliation")) {
return;
}
state = State.REGULAR_LOGIN_INTO_EXISTING_SHIB_ACCOUNT;
au = authSvc.updateLastLogin(au);
logger.fine("Found user based on " + userPersistentId + ". Logging in.");
logger.fine("Updating display info for " + au.getName());
authSvc.updateAuthenticatedUser(au, displayInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public AuthenticatedUser getUpdateAuthenticatedUser( String authenticationProvid
AuthenticatedUser user = lookupUser(authenticationProviderId, resp.getUserId());

if (user != null && !user.isDeactivated()) {
user = userService.updateLastLogin(user);
user = updateLastLogin(user);
}

if ( user == null ) {
Expand Down Expand Up @@ -655,6 +655,15 @@ public boolean identifierExists( String idtf ) {
.getSingleResult().intValue() > 0;
}

/**
* Updating user's last login date
* @param {@link AuthenticatedUser}
* @return {@link AuthenticatedUser} with last login date updated
*/
public AuthenticatedUser updateLastLogin(AuthenticatedUser user) {
return userService.updateLastLogin(user);
}

public AuthenticatedUser updateAuthenticatedUser(AuthenticatedUser user, AuthenticatedUserDisplayInfo userDisplayInfo) {
user.applyDisplayInfo(userDisplayInfo);
user.updateEmailConfirmedToNow();
Expand Down

0 comments on commit 10ceddd

Please sign in to comment.