mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-01-06 07:40:01 +01:00
Merge pull request #2267 from kounoike/fix-841
update last login date when API access.
This commit is contained in:
@@ -28,8 +28,11 @@ class ApiAuthenticationFilter extends Filter with AccessTokenService with Accoun
|
||||
.orElse {
|
||||
Option(request.getSession.getAttribute(Keys.Session.LoginAccount).asInstanceOf[Account]).map(Right(_))
|
||||
} match {
|
||||
case Some(Right(account)) => request.setAttribute(Keys.Session.LoginAccount, account); chain.doFilter(req, res)
|
||||
case None => chain.doFilter(req, res)
|
||||
case Some(Right(account)) =>
|
||||
request.setAttribute(Keys.Session.LoginAccount, account)
|
||||
updateLastLoginDate(account.userName)
|
||||
chain.doFilter(req, res)
|
||||
case None => chain.doFilter(req, res)
|
||||
case Some(Left(_)) => {
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED)
|
||||
response.setContentType("application/json; charset=utf-8")
|
||||
|
||||
Reference in New Issue
Block a user