Skip to content

Commit

Permalink
EPMRPP-95299 update last login time (#348)
Browse files Browse the repository at this point in the history
* EPMRPP-95299 update last login time
  • Loading branch information
grabsefx authored Nov 22, 2024
1 parent f392f7a commit 2dfcc44
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.epam.ta.reportportal.entity.project.Project;
import com.epam.ta.reportportal.entity.user.User;
import com.epam.ta.reportportal.util.PersonalProjectService;
import java.time.Instant;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
Expand Down Expand Up @@ -61,9 +60,7 @@ public void onApplicationEvent(UiUserSignedInEvent event) {
SecurityContextHolder.clearContext();
throw new LockedException("User account is locked");
}
userRepository.updateLastLoginDate(
Instant.ofEpochMilli(event.getTimestamp()),
username);
userRepository.updateLastLoginDate(username);

if (MapUtils.isEmpty(acquireUser(event.getAuthentication()).getProjectDetails())) {
User user = userRepository.findByLogin(username)
Expand Down

0 comments on commit 2dfcc44

Please sign in to comment.