SSO 로그인시 role 세션 저장관련 NPE 대응

This commit is contained in:
Rinjae
2026-01-15 18:38:10 +09:00
parent 06e38b44f6
commit 483ef16e81
2 changed files with 12 additions and 5 deletions
@@ -291,7 +291,7 @@ public class MainController implements InterceptorSkipController {
session.setAttribute("userId", userInfo.getUserid());
session.setAttribute("dualLogin", "N");
SessionManager.forceRegisterUserSession(request, dto);
session.setAttribute(CommonConstants.LOGIN, dto);
// roleList가 설정된 후 loadUserInfoAndSetupSession 내부에서 세션에 저장됨
String result = loadUserInfoAndSetupSession(request, session, dto, userInfo);
@@ -98,7 +98,10 @@ public class SessionManager {
*/
public static List<String> getRoleId(HttpServletRequest request) {
LoginVo login = (LoginVo)request.getSession().getAttribute(CommonConstants.LOGIN);
return login.getRoleList();
if (login == null) {
return null;
}
return login.getRoleList();
}
/**
* 세션에서 RoleID를 얻어오는 메소드
@@ -108,12 +111,16 @@ public class SessionManager {
*/
public static String getRoleIdString(HttpServletRequest request) {
LoginVo login = (LoginVo)request.getSession().getAttribute(CommonConstants.LOGIN);
if (login == null) {
return null;
}
List<String> roleList = login.getRoleList();
List<String> roleList = login.getRoleList();
if (roleList == null || roleList.isEmpty()) {
return null;
}
String roles = "";
for(String role : roleList){