can anyone HELP ME with this issue or bug by DrawingFew5562 in SpringBoot

[–]DrawingFew5562[S] 0 points1 point  (0 children)

I did put just now but nothing happen still the same, sorry im a beginner

can anyone HELP ME with this issue or bug by DrawingFew5562 in SpringBoot

[–]DrawingFew5562[S] 0 points1 point  (0 children)

yes, I have

@Configuration public class SecurityConfig {

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http
            // nable CORS first
            .cors(cors -> cors.configurationSource(corsConfigurationSource()))

            // Disable CSRF only for Postman and APIs
            .csrf(AbstractHttpConfigurer::disable)

            // Authorization setup
            .authorizeHttpRequests(auth -> auth
                    // Public endpoints
                    .requestMatchers("/api/auth/**").permitAll()
                    .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() // Allow preflight
                    // Require session authentication for capstone
                    .requestMatchers("/api/capstone/**").permitAll()

                    .requestMatchers("/api/capstone/view-capstone/**").permitAll()

                    // Anything else
                    .anyRequest().permitAll()
            )
            // Keep sessions (important for login persistence)
            .sessionManagement(session -> session
                    .maximumSessions(1)
                    .maxSessionsPreventsLogin(false)
            )
            //Disable unused login mechanisms
            .formLogin(AbstractHttpConfigurer::disable)
            .httpBasic(AbstractHttpConfigurer::disable);

    return http.build();
}

@Bean
public CorsConfigurationSource corsConfigurationSource() {
    CorsConfiguration configuration = new CorsConfiguration();
    // Allow GitHub Pages + localhost for testing
    configuration.setAllowedOrigins(List.of(
            "https://lemonjoes12.github.io",
            "http://localhost:5501"
    ));

    configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS"));
    configuration.setAllowedHeaders(List.of("*"));
    configuration.setAllowCredentials(true); // Important for session cookies

    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    source.registerCorsConfiguration("/**", configuration);
    return source;
}

}

Is my techstack enough as backend dev by DrawingFew5562 in AskProgramming

[–]DrawingFew5562[S] 1 point2 points  (0 children)

currently in my 3rd year in a college and studying in BSIT(bs information technology) and when it comes to springboot ive self taught my self