y2kcoders / skatepark.co

https://y2kcoders.github.io/skatepark.co/
MIT License
1 stars 0 forks source link

running localhost and fixing delete #10

Open Jyustin opened 9 months ago

Jyustin commented 9 months ago
Jyustin commented 9 months ago

fetch works local-local now, the following line was changed in securityconfig.java:

@Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); configuration.setAllowedOrigins(Arrays.asList("https://y2kcoders.github.io/","http://127.0.0.1:4100")); // Add other allowed origins if // needed configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); configuration.setAllowedHeaders(Arrays.asList("Content-Type", "Authorization", "x-csrf-token")); configuration.setAllowCredentials(true); // Allow credentials UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", configuration); return source; }

Jyustin commented 9 months ago

I added local origin to setAllowedOrigins

Jyustin commented 9 months ago

delete also works local-local, will push changes

Jyustin commented 9 months ago

still doesn't work

Jyustin commented 9 months ago

deployed-local delete works though, so I know frontend matter is NOT the problem, problem lies in aws backend deployment

Jyustin commented 9 months ago

delete now works. line was changed in nginx config file.

Image

changed the allowed-origin to our specific frontend instead of * wildcard.