-
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 branch 'develop' of https://github.com/TasQueue/Back-End into f…
…eat/yongsoo
- Loading branch information
Showing
16 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+246 Bytes
(100%)
build/classes/java/main/com/example/taskqueue/config/SecurityConfig.class
Binary file not shown.
Binary file modified
BIN
+95 Bytes
(100%)
build/classes/java/main/com/example/taskqueue/config/WebMvcConfig.class
Binary file not shown.
Binary file modified
BIN
+170 Bytes
(110%)
build/classes/java/main/com/example/taskqueue/oauth/controller/TokenController.class
Binary file not shown.
Binary file modified
BIN
+21 Bytes
(100%)
build/classes/java/main/com/example/taskqueue/oauth/service/CustomOAuth2UserService.class
Binary file not shown.
Binary file not shown.
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
33 changes: 33 additions & 0 deletions
33
src/main/java/com/example/taskqueue/security/filter/CustomCorsFilter.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,33 @@ | ||
package com.example.taskqueue.security.filter; | ||
|
||
import org.springframework.core.Ordered; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.stereotype.Component; | ||
import javax.servlet.Filter; | ||
import javax.servlet.FilterChain; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
import javax.servlet.annotation.WebFilter; | ||
import javax.servlet.http.HttpServletResponse; | ||
import java.io.IOException; | ||
|
||
|
||
@Component | ||
@WebFilter("/*") | ||
@Order(Ordered.HIGHEST_PRECEDENCE) | ||
public class CustomCorsFilter implements Filter { | ||
@Override | ||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | ||
throws IOException, ServletException { | ||
HttpServletResponse httpResponse = (HttpServletResponse) response; // Cast to HttpServletResponse | ||
// Add the necessary CORS headers | ||
httpResponse.setHeader("Access-Control-Allow-Origin", "http://localhost:3000"); // Adjust this based on your needs | ||
httpResponse.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); | ||
httpResponse.setHeader("Access-Control-Allow-Headers", "Authorization, Content-Type"); | ||
httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); | ||
|
||
// Continue with the request | ||
chain.doFilter(request, response); | ||
} | ||
} |