mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 04:56:02 +01:00
commit updateLastLoginDate before processing filter (#2285)
This commit is contained in:
committed by
Naoki Takezoe
parent
8ad0b25023
commit
9dc148dace
@@ -7,6 +7,7 @@ import gitbucket.core.model.Account
|
||||
import gitbucket.core.service.SystemSettingsService.SystemSettings
|
||||
import gitbucket.core.service.{AccessTokenService, AccountService, SystemSettingsService}
|
||||
import gitbucket.core.util.{AuthUtil, Keys}
|
||||
import gitbucket.core.model.Profile.profile.blockingApi._
|
||||
|
||||
class ApiAuthenticationFilter extends Filter with AccessTokenService with AccountService with SystemSettingsService {
|
||||
|
||||
@@ -33,7 +34,9 @@ class ApiAuthenticationFilter extends Filter with AccessTokenService with Accoun
|
||||
} match {
|
||||
case Some(Right(account)) =>
|
||||
request.setAttribute(Keys.Session.LoginAccount, account)
|
||||
updateLastLoginDate(account.userName)
|
||||
Database() withTransaction { implicit session =>
|
||||
updateLastLoginDate(account.userName)
|
||||
}
|
||||
chain.doFilter(req, res)
|
||||
case None => chain.doFilter(req, res)
|
||||
case Some(Left(_)) => {
|
||||
|
||||
Reference in New Issue
Block a user