Getting CORS error

I’m getting the CORS issue and it’s because the CORS mapping is missing from the backend. Before adding it to the backend I tried using the chrome extension. It works for some of the APIs but when I’m
trying to access admin APIs it throws a different error.

CORS extension enabled:
image

Then I tried adding the CORS mapping to the backend and still no luck. I can’t continue with the emailing function because of this issue.

package org.sefglobal.scholarx.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
    // Todo: Remove this configuration after congiguration of API gateway
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("http://localhost:3000")
                .allowedMethods("PUT", "DELETE", "GET", "POST")
                .allowCredentials(true)
                .maxAge(3600);
    }
}

@EngTeam

1 Like

Is this the change state endpoint?
I think yesterday I tried it out, there was no issues in my machine though, I was using safari inbuilt function to disable cors restrictions.
Anyways I’ll try to reproduce the error from my end once again and let you know.