Package com.jangular.backend.service
Class UserLoginHistoryService
java.lang.Object
com.jangular.backend.service.UserLoginHistoryService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetActiveSessions(Long userId) Get active sessions (logins without logout)getFailedLogins(Long userId) Get failed login attemptsgetLoginHistoryBetween(Long userId, LocalDateTime startDate, LocalDateTime endDate) Get login history within a date rangegetSuccessfulLogins(Long userId) Get successful login historygetUserLoginHistory(Long userId) Get user login historyrecordLoginAttempt(Long userId, String ipAddress, String userAgent, boolean successful, String errorMessage) Record a login attempt (successful or failed)voidrecordLogout(Long userId) Record a user logout
-
Constructor Details
-
UserLoginHistoryService
public UserLoginHistoryService()
-
-
Method Details
-
recordLoginAttempt
@Transactional public UserLoginHistory recordLoginAttempt(Long userId, String ipAddress, String userAgent, boolean successful, String errorMessage) Record a login attempt (successful or failed) -
recordLogout
Record a user logout -
getUserLoginHistory
Get user login history -
getSuccessfulLogins
Get successful login history -
getFailedLogins
Get failed login attempts -
getActiveSessions
Get active sessions (logins without logout) -
getLoginHistoryBetween
public List<UserLoginHistory> getLoginHistoryBetween(Long userId, LocalDateTime startDate, LocalDateTime endDate) Get login history within a date range
-