diff --git a/ride_fast_backend/src/main/java/com/ridefast/ride_fast_backend/config/SecurityConfig.java b/ride_fast_backend/src/main/java/com/ridefast/ride_fast_backend/config/SecurityConfig.java index 692fff4..ad143ee 100644 --- a/ride_fast_backend/src/main/java/com/ridefast/ride_fast_backend/config/SecurityConfig.java +++ b/ride_fast_backend/src/main/java/com/ridefast/ride_fast_backend/config/SecurityConfig.java @@ -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("*"); @@ -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)) @@ -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; } } \ No newline at end of file diff --git a/ride_fast_frontend/next.config.mjs b/ride_fast_frontend/next.config.mjs index 04e7734..42bde30 100644 --- a/ride_fast_frontend/next.config.mjs +++ b/ride_fast_frontend/next.config.mjs @@ -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*", }, ]; },