Skip to content

Commit

Permalink
Merge pull request #90 from plx927/feature/fix-formAuthenticationFilter
Browse files Browse the repository at this point in the history
[SHIRO-661] Add check for the principal of subject whether is null
  • Loading branch information
fpapon committed May 17, 2019
2 parents 22a2612 + 148eeb7 commit cf8f43f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -294,7 +294,7 @@ public void login(AuthenticationToken token) throws AuthenticationException {
}

public boolean isAuthenticated() {
return authenticated;
return authenticated && hasPrincipals();
}

public boolean isRemembered() {
Expand Down
Expand Up @@ -78,7 +78,7 @@ public void setSuccessUrl(String successUrl) {
*/
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
Subject subject = getSubject(request, response);
return subject.isAuthenticated();
return subject.isAuthenticated() && subject.getPrincipal() != null;
}

/**
Expand Down

0 comments on commit cf8f43f

Please sign in to comment.