Skip to content

Commit

Permalink
updated configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshitPachori committed Jun 8, 2024
1 parent eabef87 commit 534d7db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
@Override
public CorsConfiguration getCorsConfiguration(HttpServletRequest request) {
CorsConfiguration cfg = new CorsConfiguration();
cfg.setAllowedOrigins(List.of("http://localhost:3000"));
cfg.setAllowedOrigins(
List.of("http://localhost:3000", "https://ride-fast.vercel.app/"));
cfg.addAllowedMethod("*");
cfg.setAllowCredentials(true);
cfg.addAllowedHeader("*");
Expand All @@ -54,8 +55,8 @@ public CorsConfiguration getCorsConfiguration(HttpServletRequest request) {
}
}))
.authorizeHttpRequests((authorize) -> authorize
.requestMatchers( "/api/v1/auth/**").permitAll()
.requestMatchers( "/swagger-ui/**", "/").permitAll()
.requestMatchers("/api/v1/auth/**").permitAll()
.requestMatchers("/swagger-ui/**", "/home").permitAll()
.anyRequest().authenticated())
.sessionManagement((management) -> management
.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
Expand All @@ -74,11 +75,12 @@ public PasswordEncoder passwordEncoder() {
public AuthenticationManager authenticationManager(AuthenticationConfiguration configuration) throws Exception {
return configuration.getAuthenticationManager();
}

@Bean
public DaoAuthenticationProvider daoAuthenticationProvider() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(customUserDetailsService);
provider.setPasswordEncoder(passwordEncoder());
return provider;
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(customUserDetailsService);
provider.setPasswordEncoder(passwordEncoder());
return provider;
}
}
4 changes: 3 additions & 1 deletion ride_fast_frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const nextConfig = {
return [
{
source: "/api/:path*",
destination: "http://localhost:8080/api/:path*",
// destination: "http://localhost:8080/api/:path*",
destination:
"https://ride-fast-app-backend-latest.onrender.com/api/:path*",
},
];
},
Expand Down

0 comments on commit 534d7db

Please sign in to comment.