diff --git a/src/main/scala/gitbucket/core/servlet/ApiAuthenticationFilter.scala b/src/main/scala/gitbucket/core/servlet/ApiAuthenticationFilter.scala index 4576b0c89..6ab4226ec 100644 --- a/src/main/scala/gitbucket/core/servlet/ApiAuthenticationFilter.scala +++ b/src/main/scala/gitbucket/core/servlet/ApiAuthenticationFilter.scala @@ -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 {