Skip to content

Commit a36f7ba

Browse files
authored
Merge pull request #345 from MT-TEAM-Org/epic/inquirymail
fix: jwtauth logic fix and swaager fx
2 parents c205238 + f86d154 commit a36f7ba

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.myteam.server.auth.controller;
2+
3+
import io.swagger.v3.oas.annotations.Operation;
4+
import io.swagger.v3.oas.annotations.media.Content;
5+
import io.swagger.v3.oas.annotations.media.Schema;
6+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
7+
import io.swagger.v3.oas.annotations.responses.ApiResponses;
8+
import io.swagger.v3.oas.annotations.tags.Tag;
9+
import org.myteam.server.auth.dto.AuthResponse;
10+
import org.myteam.server.global.exception.ErrorResponse;
11+
import org.springframework.web.bind.annotation.PostMapping;
12+
13+
14+
15+
@Tag(name = "관리자 인증 api", description = "관리자 로그인 관련 api")
16+
public class AdminLoginController {
17+
@Operation(summary = "관리자 로그인", description = "관리자가 로그인을 하여 토큰을 받습니다." +
18+
"계정은 username으로 비밀번호는 password를 프로퍼티로 보내주시면됩니다. 사실상 기존의 일반 회원 로그인과" +
19+
"같되 경로만 다르다고 보시면됩니다.")
20+
@ApiResponses(value = {
21+
@ApiResponse(responseCode = "200", description = "로그인 성공", content = @Content(schema = @Schema(implementation = AuthResponse.class))),
22+
@ApiResponse(responseCode = "404", description = "사용자를 찾을 수 없음", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
23+
@ApiResponse(responseCode = "500", description = "JSON 파싱 오류", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
24+
})
25+
@PostMapping("api/admin/login")
26+
public void adminLoginController(){
27+
}
28+
}

src/main/java/org/myteam/server/global/security/filter/JwtAuthenticationFilter.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,8 @@ protected void successfulAuthentication(HttpServletRequest request, HttpServletR
147147
log.debug("print accessToken: {}", accessToken);
148148
log.debug("print refreshToken: {}", refreshToken);
149149
log.debug("print role: {}", role);
150-
log.info("print role: {}", role);
151150

152-
153-
if(status.equals(MemberRole.ADMIN.name())){
151+
if(role.equals(MemberRole.ADMIN.name())){
154152
redisService.resetRequestCount("LOGIN_ADMIN",username);
155153
}
156154
redisService.putRefreshToken(publicId, refreshToken);

src/main/java/org/myteam/server/member/controller/AdminController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class AdminController {
4949
private final MemberService memberService;
5050
private final AdminMemberSearchService adminMemberSearchService;
5151

52-
@Operation(summary = "이메일로 회원 조회", description = "관리자가 특정 이메일을 가진 회원을 조회합니다.")
52+
/*@Operation(summary = "이메일로 회원 조회", description = "관리자가 특정 이메일을 가진 회원을 조회합니다.")
5353
@ApiResponses(value = {
5454
@ApiResponse(responseCode = "200", description = "회원 정보 조회 성공"),
5555
@ApiResponse(responseCode = "400", description = "잘못된 요청 형식", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@@ -99,7 +99,7 @@ public ResponseEntity<ResponseDto<String>> delete(@RequestBody MemberDeleteReque
9999
"회원 삭제 성공",
100100
null
101101
));
102-
}
102+
}*/
103103

104104
@Operation(summary = "회원 정보들을 조회", description = "각종 조건을 바탕으로 회원 정보들을 조회합니다.")
105105
@ApiResponses(value = {

0 commit comments

Comments
 (0)