Skip to content

Commit

Permalink
[#48] CORS 이슈 해결 (#50)
Browse files Browse the repository at this point in the history
* hotfix: cors 이슈 해결

* fix: picture -> profileUrl 변수명 변경
  • Loading branch information
Bellroute authored May 16, 2024
1 parent 86cafd3 commit 33be17d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public ResponseEntity<SignInUpResponse> signIn(@RequestBody @Valid SignInRequest
.nickname(memberInfo.getNickname())
.authId(memberInfo.getAuthId())
.providerType(memberInfo.getProviderType())
.picture(memberInfo.getPicture())
.profileUrl(memberInfo.getProfileUrl())
.email(memberInfo.getEmail())
.build());
}
Expand All @@ -79,7 +79,7 @@ public ResponseEntity<SignInUpResponse> signUp(@RequestBody @Valid final SignUpR
.nickname(memberInfo.getNickname())
.authId(memberInfo.getAuthId())
.providerType(memberInfo.getProviderType())
.picture(memberInfo.getPicture())
.profileUrl(memberInfo.getProfileUrl())
.email(memberInfo.getEmail())
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public class SignUpRequest {
@Size(min = 2, max = 8)
private final String nickname;

@JsonProperty("profileImage")
private final String profileImage;
@JsonProperty("profileUrl")
private final String profileUrl;

@JsonProperty("homeGymId")
private final Long homeGymId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ public class MemberInfo {
private final String authId;
private final String providerType;
private final String email;
private final String picture;
private final String profileUrl;

public MemberInfo(Member member) {
this.nickname = member.getNickname();
this.authId = member.getAuthId();
this.providerType = member.getProviderType();
this.email = member.getEmail();
this.picture= member.getProfileUrl();
this.profileUrl = member.getProfileUrl();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ public class SignInUpResponse {
private final String authId;
private final String providerType;
private final String email;
private final String picture;
private final String profileUrl;

@Builder
public SignInUpResponse(String nickname, String authId, String providerType, String email,
String picture) {
String profileUrl) {
this.nickname = nickname;
this.authId = authId;
this.providerType = providerType;
this.email = email;
this.picture = picture;
this.profileUrl = profileUrl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Map<String, Object> getAttributes() {
this.attributes.put("authId", sub);
this.attributes.put("providerType", "kakao");
this.attributes.put("email", email);
this.attributes.put("picture", picture); // 기본값: 앱 연결 시의 카카오계정 썸네일 프로필 사진 URL, 110px*110px 크기
this.attributes.put("profileUrl", picture); // 기본값: 앱 연결 시의 카카오계정 썸네일 프로필 사진 URL, 110px*110px 크기
this.attributes.put("nickname", nickname);

return this.attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class WebConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowCredentials(true)
.allowedOrigins("http://localhost:3000", "https://climingo.vercel.app", "https://stg-climingo.vercel.app", "https://dev-climingo.vercel.app")
.allowedOrigins("http://localhost:3000", "https://localhost:3000", "https://climingo.vercel.app", "https://stg-climingo.vercel.app", "https://dev-climingo.vercel.app")
.allowedMethods("*");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public MemberInfo signUp(SignUpRequest request) {
.authId(request.getAuthId())
.providerType(request.getProviderType())
.nickname(request.getNickname())
.profileUrl(request.getProfileImage())
.profileUrl(request.getProfileUrl())
.physicalInfo(request.getPhysicalInfo())
.build();

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ insert into level (id, order_num, gym_id, color_name_ko, color_name_en) values (

insert into member (id, auth_id, provider_type, nickname, profile_url, email, home_gym_id, arm_span, height, weight) values(9999, 'test_auth_id_9999', 'kakao', 'test_nickname', 'http://k.kakaocdn.net/dn/dTDso6/btsECljbpYi/JqJl8DHkrVbuwYlBlVGEkK/img_110x110.jpg', null, null, null, null, null);

insert into record(id, member_id, level_id, gym_id, video_url, thumbnail_url, content, record_date) values(1, 9999, 1, 1, 'https://climingo-api.s3.ap-northeast-2.amazonaws.com/%EB%B9%84%EB%94%94%EC%98%A4_2024-05-16T12%3A40%3A26.647632061.MOV?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240516T124028Z&X-Amz-SignedHeaders=host&X-Amz-Expires=899&X-Amz-Credential=AKIAZQ3DUVZYVS6WHY5J%2F20240516%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=24a51c8b6ab1e15390f24d9f7298c48d0f16884c160549e64a3ebb33135fe1c2', 'https://climingo-api.s3.ap-northeast-2.amazonaws.com/%EC%8D%B8%EB%84%A4%EC%9D%BC_2024-05-16T21%3A35%3A57.247394.jpg', 'test_content', CURRENT_TIMESTAMP());
insert into record(id, member_id, level_id, gym_id, video_url, thumbnail_url, content, record_date) values(1, 9999, 1, 1, 'https://climingo-api.s3.ap-northeast-2.amazonaws.com/%EB%B9%84%EB%94%94%EC%98%A4_2024-05-16T12%3A40%3A26.647632061.MOV', 'https://climingo-api.s3.ap-northeast-2.amazonaws.com/%EC%8D%B8%EB%84%A4%EC%9D%BC_2024-05-16T21%3A35%3A57.247394.jpg', 'test_content', CURRENT_TIMESTAMP());

0 comments on commit 33be17d

Please sign in to comment.