mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
In case of authentication failure, add a clear response code
This commit is contained in:
@@ -67,6 +67,7 @@ public class LoginServiceImpl implements LoginService {
|
||||
if (ValidateUtils.isNull(classRequestMappingValue)) {
|
||||
LOGGER.error("class=LoginServiceImpl||method=checkLogin||msg=uri illegal||uri={}", request.getRequestURI());
|
||||
singleSignOn.setRedirectToLoginPage(response);
|
||||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -83,6 +84,7 @@ public class LoginServiceImpl implements LoginService {
|
||||
if (ValidateUtils.isBlank(username)) {
|
||||
// 未登录, 则返回false, 同时重定向到登录页面
|
||||
singleSignOn.setRedirectToLoginPage(response);
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -113,4 +115,4 @@ public class LoginServiceImpl implements LoginService {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user