Skip to content

Commit

Permalink
Feature/marp 721 fix nginx cannot redirect user after authenticated f…
Browse files Browse the repository at this point in the history
…rom GitHub (#49)
  • Loading branch information
ndkhanh-axonivy authored Jul 23, 2024
1 parent e3314fd commit ad95e24
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions marketplace-build/config/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
events{}
events {}

http {
# include the default mime.types to map file extensions to MIME types
include /etc/nginx/mime.types;

server {
root /usr/share/nginx/html;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
}

error_page 404 /404.html;
location = /404.html {
internal;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class WebConfig implements WebMvcConfigurer {
private static final String[] EXCLUDE_PATHS = { "/", "/swagger-ui/**", "/api-docs/**" };
private static final String[] ALLOWED_HEADERS = { "Accept-Language", "Content-Type", "Authorization",
"X-Requested-By", "x-requested-with", "X-Forwarded-Host", "x-xsrf-token" };
private static final String[] ALLOWED_METHODS = { "GET", "OPTIONS" };
private static final String[] ALLOWED_METHODS = { "GET", "OPTIONS", "POST" };

private final MarketHeaderInterceptor headerInterceptor;

Expand All @@ -30,7 +30,7 @@ public void addInterceptors(InterceptorRegistry registry) {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*").allowedMethods(ALLOWED_METHODS).allowedHeaders(ALLOWED_HEADERS)
registry.addMapping("/**").allowedOrigins("http://marketplace.server.ivy-cloud.com:4200").allowedMethods(ALLOWED_METHODS).allowedHeaders(ALLOWED_HEADERS)
.maxAge(marketCorsAllowedOriginMaxAge);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public FeedbackServiceImpl(FeedbackRepository feedbackRepository, UserRepository
@Override
public Page<Feedback> findFeedbacks(String productId, Pageable pageable) throws NotFoundException {
validateProductExists(productId);
return feedbackRepository.searchByProductId(productId, pageable);
return feedbackRepository.searchByProductId("", pageable);
}

@Override
Expand Down

0 comments on commit ad95e24

Please sign in to comment.