Skip to content

Commit

Permalink
Adding more debug around UserLockedChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
simonredfern committed Jan 5, 2024
1 parent bdafe27 commit edc9ed8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions obp-api/src/main/scala/bootstrap/liftweb/Boot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -756,25 +756,30 @@ class Boot extends MdcLoggable {
def onBeginServicing(session: LiftSession, req: Req): Unit = {
logger.debug(s"Hello from UsernameLockedChecker.onBeginServicing")
checkIsLocked()
logger.debug(s"Bye from UsernameLockedChecker.onBeginServicing")
}
def onSessionActivate(session: LiftSession): Unit = {
logger.debug(s"Hello from UsernameLockedChecker.onSessionActivate")
checkIsLocked()
logger.debug(s"Bye from UsernameLockedChecker.onSessionActivate")
}
def onSessionPassivate(session: LiftSession): Unit = {
logger.debug(s"Hello from UsernameLockedChecker.onSessionPassivate")
checkIsLocked()
logger.debug(s"Bye from UsernameLockedChecker.onSessionPassivate")
}
private def checkIsLocked(): Unit = {
AuthUser.currentUser match {
case Full(user) =>
LoginAttempt.userIsLocked(localIdentityProvider, user.username.get) match {
case true =>
AuthUser.logoutCurrentUser
logger.warn(s"User ${user.username.get} has been logged out due to it has been locked.")
logger.warn(s"checkIsLocked says: User ${user.username.get} has been logged out because it is locked.")
case false => // Do nothing
logger.debug(s"checkIsLocked says: User ${user.username.get} is not locked.")
}
case _ => // Do nothing
case _ => // No user found
logger.debug(s"checkIsLocked says: No User Found.")
}
}
}
Expand Down

0 comments on commit edc9ed8

Please sign in to comment.