mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +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 auth if auth.startsWith("Basic ") => doBasicAuth(auth, loadSystemSettings(), request).toRight(())
|
||||||
case _ => Left(())
|
case _ => Left(())
|
||||||
}
|
}
|
||||||
|
.orElse {
|
||||||
|
Option(req.getParameter("access_token")).map(AccessTokenService.getAccountByAccessToken(_).toRight(()))
|
||||||
|
}
|
||||||
.orElse {
|
.orElse {
|
||||||
Option(request.getSession.getAttribute(Keys.Session.LoginAccount).asInstanceOf[Account]).map(Right(_))
|
Option(request.getSession.getAttribute(Keys.Session.LoginAccount).asInstanceOf[Account]).map(Right(_))
|
||||||
} match {
|
} match {
|
||||||
|
|||||||
Reference in New Issue
Block a user