in cdslogviewer/app/auth/Security.scala [145:159]
private def onUnauthorized(request: RequestHeader, loginResult: LoginResult) = loginResult match {
case LoginResultInvalid(_)=>
Results.Forbidden(Json.obj("status"->"error","detail"->"Invalid credentials"))
case LoginResultExpired(user:String)=>
Results.Unauthorized(Json.obj("status"->"expired","detail"->"Your login has expired","username"->user))
case LoginResultExpired(_)=> //this shouldn't happen, but it keeps the compiler happy
Results.Unauthorized(Json.obj("status"->"expired"))
case LoginResultMisconfigured(_)=>
Results.InternalServerError(Json.obj("status"->"error","detail"->"Server configuration error, please check the logs"))
case LoginResultNotPresent=>
Results.Forbidden(Json.obj("status"->"error","detail"->"No credentials provided"))
case LoginResultOK(user)=>
logger.error(s"LoginResultOK passed to onUnauthorized! This must be a bug. Username is $user.")
Results.InternalServerError(Json.obj("status"->"logic_error","detail"->"Login should have succeeded but error handler called. This is a server bug."))
}