-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[feat]: 회원탈퇴 API 구현
- Loading branch information
Showing
21 changed files
with
223 additions
and
48 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/com/onnoff/onnoff/auth/config/FilterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.onnoff.onnoff.auth.config; | ||
|
||
import com.onnoff.onnoff.auth.jwt.filter.JwtAuthFilter; | ||
import com.onnoff.onnoff.auth.jwt.filter.UserInterceptor; | ||
import com.onnoff.onnoff.auth.jwt.service.JwtUtil; | ||
import com.onnoff.onnoff.auth.jwt.service.TokenProvider; | ||
import com.onnoff.onnoff.domain.user.service.UserService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class FilterConfig { | ||
private final TokenProvider tokenProvider; | ||
private final UserService userService; | ||
private final JwtUtil jwtUtil; | ||
|
||
@Bean | ||
public JwtAuthFilter jwtAuthFilter() { | ||
return new JwtAuthFilter(tokenProvider); | ||
} | ||
|
||
@Bean | ||
public UserInterceptor userInterceptor() { | ||
return new UserInterceptor(userService, jwtUtil); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/onnoff/onnoff/auth/feignClient/dto/apple/RevokeTokenReqeust.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.onnoff.onnoff.auth.feignClient.dto.apple; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.springframework.util.LinkedMultiValueMap; | ||
import org.springframework.util.MultiValueMap; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
public class RevokeTokenReqeust { | ||
private String clientId; | ||
private String clientSecret; | ||
private String token; | ||
private String tokenTypeHint; | ||
|
||
public MultiValueMap<String, String> toUrlEncoded(){ | ||
LinkedMultiValueMap<String, String> urlEncoded = new LinkedMultiValueMap<>(); | ||
urlEncoded.add("client_id", clientId); | ||
urlEncoded.add("client_secret", clientSecret); | ||
urlEncoded.add("token", token); | ||
urlEncoded.add("token_type_hint", "refresh_token"); | ||
return urlEncoded; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/onnoff/onnoff/auth/feignClient/dto/kakao/UnlinkRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.onnoff.onnoff.auth.feignClient.dto.kakao; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import org.springframework.util.LinkedMultiValueMap; | ||
import org.springframework.util.MultiValueMap; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
public class UnlinkRequest { | ||
private String targetIdType; | ||
private String targetId; | ||
|
||
public MultiValueMap<String, String> toUrlEncoded(){ | ||
LinkedMultiValueMap<String, String> urlEncoded = new LinkedMultiValueMap<>(); | ||
urlEncoded.add("target_id_type", targetIdType); | ||
urlEncoded.add("target_id", targetId); | ||
return urlEncoded; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/com/onnoff/onnoff/auth/jwt/service/TokenProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.onnoff.onnoff.auth.jwt.service; | ||
|
||
public interface TokenProvider { | ||
boolean verifyToken(String token); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.