Skip to content

Commit

Permalink
Merge pull request #120 from team-dodal/bug/#119
Browse files Browse the repository at this point in the history
#119 - 회원가입 오류 수정
  • Loading branch information
sasca37 authored Feb 9, 2024
2 parents 0a2c192 + 5728415 commit e568d73
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/github-actions-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: CI & CD for dodal-dev

on:
push:
branches: [ "refactor/#116" ]
branches: [ "bug/#119" ]


env:
S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME_DEV }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class SecurityConfig {
@Value("${jwt.secret-key}")
private String key;

@Value("${server.ip}")
private String serverIp;
@Bean
@Order(0)
public SecurityFilterChain resources(HttpSecurity http) throws Exception {
Expand Down Expand Up @@ -61,7 +63,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.authorizeHttpRequests() // URL 별 권한 설정
.anyRequest().authenticated()
.and()
.addFilterBefore(new JwtTokenFilter(key, userService), UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(new JwtTokenFilter(key, userService, serverIp), UsernamePasswordAuthenticationFilter.class)
.exceptionHandling()
.authenticationEntryPoint(new CustomAuthenticationEntryPoint(new ObjectMapper()))
.and()
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/dodal/meet/filter/JwtTokenFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class JwtTokenFilter extends OncePerRequestFilter {
private final String key;
private final UserService userService;

private final String serverIp;

@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {

Expand All @@ -38,7 +40,10 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
try {
final String header = request.getHeader(HttpHeaders.AUTHORIZATION);
if (header == null || !header.startsWith("Bearer ")) {
log.error("Request header is null or invalid {}", request.getRequestURL());
String requestURL = request.getRequestURL().toString();
if (requestURL.indexOf(serverIp) == -1 && requestURL.indexOf("localhost") == -1) {
log.error("Request header is null or invalid {}", request.getRequestURL());
}
filterChain.doFilter(request, response);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/dodal/meet/model/entity/UserEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class UserEntity extends BaseTime {
@Column(nullable = false, length = 16)
private String nickname;

@Column(nullable = false, length = 20)
@Column(nullable = false, length = 200)
private String socialId;

@Column(nullable = false, length = 10)
Expand Down
14 changes: 13 additions & 1 deletion src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,23 @@ spring:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
topic:
push: fcm
push: fcm-local

server:
url: http://localhost:8080

cloud:
aws:
credentials:
access-key: AKIAXYKJWO36P4ZGAXFV
secret-key: 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
s3:
bucket: dodal-bucket
region:
static: ap-northeast-2
stack:
auto: false

logging:
level:
com:
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spring:
platform: mysql
server:
url: http://localhost:8080
ip: 127.0.0.1
logging:
level:
com:
Expand Down

0 comments on commit e568d73

Please sign in to comment.