Skip to content

Commit

Permalink
Merge pull request #34 from Na-o-man/fix/#29/image-column-and-redirec…
Browse files Browse the repository at this point in the history
…tion

[FIX] 프로필 이미지 컬럼 크기 변경, 약관 동의화면 경로 변경, CORS 설정
  • Loading branch information
bflykky authored Jul 31, 2024
2 parents b0a44c3 + d5364e5 commit 544337a
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/umc/naoman/NaomanApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
@SpringBootApplication
@Slf4j
public class NaomanApplication {

public static void main(String[] args) {
SpringApplication.run(NaomanApplication.class, args);
}

@PostConstruct
public void setTimeZone() {
log.debug("타임존 설정 전 현재 시각: {}", ZonedDateTime.now());
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
log.debug("타임존 설정 후 현재 시각: {}", ZonedDateTime.now());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AuthController {
private final MemberService memberService;

@PostMapping("/signup/web")
@Operation(summary = "회원가입 API(웹)", description = "웹 클라이언트가 사용하는 회원가입 요청 API입니다.")
@Operation(summary = "회원가입 API(웹)", description = "웹 클라이언트가 사용하는 회원가입 API입니다.")
@Parameters(value = {
@Parameter(name = "temp-member-info", description = "리다이렉션 시에 쿠키로 넘겨준 사용자 정보가 담긴 jwt를 헤더로 넘겨주세요.",
in = ParameterIn.HEADER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ public static class SignupRequest {
@NoArgsConstructor
@AllArgsConstructor
public static class LoginRequest {
@NotNull(message = "로그인한 소셜 플랫폼에서 제공한 회원 번호를 필수로 입력해야 합니다.")
private String authId;
@NotNull(message = "socialType은 KAKAO, GOOGLE 중 하나를 입력해야 합니다.")
private SocialType socialType;

@NotNull(message = "로그인한 소셜 플랫폼에서 제공한 회원 번호를 필수로 입력해야 합니다.")
private String authId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class Member extends BaseTimeEntity {
private String email;
@Column(nullable = false)
private String name;
@Column(length = 2000)
private String image;
@Column(name = "auth_id", nullable = false)
private String authId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class Profile {
private Long id;
@Column(nullable = false)
private String name;
@Column(length = 2000)
private String image;
@Enumerated(EnumType.STRING)
private Role role;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public OpenAPI openAPI() {
SecurityRequirement securityRequirement = new SecurityRequirement().addList("bearerAuth");

Server server = new Server();
server.setUrl("http://52.79.212.19");
server.setUrl("https://naoman.site");

Server local = new Server();
local.setUrl("http://localhost:8080");
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/umc/naoman/global/config/WebMvcConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.umc.naoman.global.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowCredentials(true)
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedHeaders("*")
.maxAge(3600);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class OAuth2LoginSuccessHandler implements AuthenticationSuccessHandler {
private static final String AUTHORIZATION_HEADER = "Authorization";
private static final String REFRESH_TOKEN_KEY = "refresh-token";
private static final String TEMP_MEMBER_INFO_KEY = "temp-member-info";
private static final String FRONTEND_BASE_URL = "http://localhost:3000";
private static final String FRONTEND_AGREEMENT_PATH = "/enter/login/clause";
private static final String FRONTEND_BASE_URL = "https://www.naver.com";
private static final String FRONTEND_AGREEMENT_PATH = "/login/clause";

@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Expand Down

0 comments on commit 544337a

Please sign in to comment.