mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-04 20:45:58 +01:00
Merge pull request #2277 from kounoike/pr-auth-querystring
add parameter style token authentication
This commit is contained in:
@@ -25,6 +25,9 @@ class ApiAuthenticationFilter extends Filter with AccessTokenService with Accoun
|
||||
case auth if auth.startsWith("Basic ") => doBasicAuth(auth, loadSystemSettings(), request).toRight(())
|
||||
case _ => Left(())
|
||||
}
|
||||
.orElse {
|
||||
Option(req.getParameter("access_token")).map(AccessTokenService.getAccountByAccessToken(_).toRight(()))
|
||||
}
|
||||
.orElse {
|
||||
Option(request.getSession.getAttribute(Keys.Session.LoginAccount).asInstanceOf[Account]).map(Right(_))
|
||||
} match {
|
||||
|
||||
Reference in New Issue
Block a user