【单点登录】未找到用户处理
This commit is contained in:
parent
95e59c82f4
commit
c283299fc8
|
@ -104,14 +104,6 @@ public class Oauth2Filter extends AuthenticatingFilter {
|
|||
return false;
|
||||
}
|
||||
|
||||
private String getYaweiUserIdCookieInResponse(HttpServletResponse response) {
|
||||
String userIdKey = "UserID=";
|
||||
for (String header : response.getHeaders("set-cookie")) {
|
||||
if (header.startsWith(userIdKey)) return header.substring(userIdKey.length());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) {
|
||||
try {
|
||||
|
@ -233,6 +225,8 @@ public class Oauth2Filter extends AuthenticatingFilter {
|
|||
|
||||
request.setAttribute(Constant.TOKEN_HEADER, currentToken);
|
||||
return executeLogin(request, response);
|
||||
}else {
|
||||
send401Error(response, "未找到相关用户");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue