This commit is contained in:
parent
7eaa24e4fc
commit
163fdb34cb
@ -30,9 +30,11 @@ import org.springframework.security.core.context.SecurityContext;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.context.SecurityContextHolderStrategy;
|
||||
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
@ -241,6 +243,9 @@ public class UserController {
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
// @GetMapping("checkUserSession")
|
||||
// public
|
||||
|
||||
|
||||
// 유저 세션 체크
|
||||
@ -257,6 +262,21 @@ public class UserController {
|
||||
}
|
||||
return ApiResponse.ok(sessionData);
|
||||
}
|
||||
|
||||
// 유저 세션 권한 체크
|
||||
@PostMapping(value = "authCheck")
|
||||
public ApiResponse<?> authCheck(@ReqMap MapDto map) {
|
||||
String memberId = map.getString("memberId");
|
||||
if(!StringUtils.hasText(memberId)) return ApiResponse.error(HttpStatus.BAD_REQUEST, "파라미터 오류");
|
||||
|
||||
String userRole = "";
|
||||
MemberVo vo = AuthUtil.getUser();
|
||||
if(vo != null && memberId.equals(vo.getLoginId())) {
|
||||
userRole = vo.getRole();
|
||||
}
|
||||
|
||||
return ApiResponse.ok(userRole);
|
||||
}
|
||||
|
||||
// rememberMe 확인용
|
||||
@GetMapping(value = "rememberCheck")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user