add parameter style token authentication

This commit is contained in:
KOUNOIKE
2019-03-02 15:35:38 +09:00
parent 81acfaa424
commit 06c9609587

View File

@@ -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 {