-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from ShallWeProject/develop
feat: 애플/구글/카카오 로그인 통합 및 탈퇴 로직 구현
- Loading branch information
Showing
9 changed files
with
137 additions
and
16 deletions.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
src/main/java/com/shallwe/domain/auth/dto/request/AppleTokenRevokeReq.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,20 @@ | ||
package com.shallwe.domain.auth.dto.request; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class AppleTokenRevokeReq { | ||
|
||
private String client_id; | ||
private String client_secret; | ||
private String token; | ||
|
||
public static AppleTokenRevokeReq of(String clientId, String clientSecret, String token) { | ||
AppleTokenRevokeReq request = new AppleTokenRevokeReq(); | ||
request.client_id = clientId; | ||
request.client_secret = clientSecret; | ||
request.token = token; | ||
return request; | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/shallwe/domain/auth/exception/InvalidOAuth2RefreshTokenException.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,9 @@ | ||
package com.shallwe.domain.auth.exception; | ||
|
||
public class InvalidOAuth2RefreshTokenException extends RuntimeException { | ||
|
||
public InvalidOAuth2RefreshTokenException() { | ||
super("유효하지 않은 oauth2 refresh 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
package com.shallwe.global.config; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpMethod; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@RequiredArgsConstructor | ||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
|
||
private final long MAX_AGE_SECS = 3600; | ||
|
||
@Value("${app.cors.allowed-origins}") | ||
private String[] allowedOrigins; | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") // url 패턴 | ||
.allowedOriginPatterns("*") | ||
// todo: server url 생성 시 변경 필요 | ||
.allowedOrigins("https://api.shallwes.com/") | ||
.allowedMethods(HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.PATCH.name(), HttpMethod.DELETE.name(), HttpMethod.OPTIONS.name(), | ||
HttpMethod.HEAD.name(), HttpMethod.TRACE.name(), HttpMethod.OPTIONS.name()) // 허용 method | ||
.allowedHeaders("Authorization", "Content-Type")// 허용 header | ||
.allowCredentials(true); | ||
|
||
|
||
.allowedOrigins(allowedOrigins) | ||
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") | ||
.allowedHeaders("*")// 허용 header | ||
.allowCredentials(true) | ||
.maxAge(MAX_AGE_SECS); | ||
} | ||
} |
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