Skip to content

Commit

Permalink
allow stats api requests
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed May 9, 2020
1 parent 2d1d39d commit 6a81432
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ private ParaObject checkApiAuth(HttpServletRequest req) {
return null;
}
String apiKeyJWT = StringUtils.removeStart(req.getHeader(HttpHeaders.AUTHORIZATION), "Bearer ");
if (!isApiEnabled() || StringUtils.isBlank(apiKeyJWT) || !isValidJWToken(apiKeyJWT)) {
if (req.getRequestURI().equals(CONTEXT_PATH + "/api/stats") && isValidJWToken(apiKeyJWT)) {
return API_USER;
} else if (!isApiEnabled() || StringUtils.isBlank(apiKeyJWT) || !isValidJWToken(apiKeyJWT)) {
throw new WebApplicationException(401);
}
return API_USER;
Expand Down

0 comments on commit 6a81432

Please sign in to comment.