Skip to content

Commit

Permalink
fix: secure logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fivesmallq committed Apr 17, 2018
1 parent d7c8ece commit 7656a7d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Add it to your ``dependencies.yml``
```yaml
require:
- play
- play1-base -> api 0.3.6
- play1-base -> api 0.3.7
repositories:
- play-api:
type: http
artifact: http://pek3a.qingstor.com/playbase/play-api/api-0.3.6.zip
artifact: http://pek3a.qingstor.com/playbase/play-api/api-0.3.7.zip
contains:
- play1-base -> api
```
Expand Down
6 changes: 2 additions & 4 deletions api/app/controllers/api/interceptor/Secure.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ static void checkAccess() {
token = header.value();
//header value with 'Bearer'
token = StringUtils.substringAfter(token, "Bearer").trim();
} else if (Boolean.parseBoolean(enableQueryStringAuth)) {
if (StringUtils.isNotBlank(authQuery)) {
token = authQuery;
}
} else if (StringUtils.isNotBlank(authQuery) && Boolean.parseBoolean(enableQueryStringAuth)) {
token = authQuery;
} else if (Boolean.parseBoolean(enableCookieAuth)) {
if (cookie != null && StringUtils.isNotEmpty(cookie.value)) {
token = cookie.value;
Expand Down
2 changes: 1 addition & 1 deletion api/conf/dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
self: play -> api 0.3.6
self: play -> api 0.3.7

require:
- play 1.4
Expand Down
2 changes: 1 addition & 1 deletion demo/conf/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require:
- play
- play1-base -> api 0.3.6
- play1-base -> api 0.3.7
- play1-base -> jongo 0.1
- play-codeborne -> logger 2.1
repositories:
Expand Down

0 comments on commit 7656a7d

Please sign in to comment.