CORS with angular failing to load

Failed to load
http:/www.website.com/apis/login: Request header field apitoken is not allowed by Access-Control-Allow-Headers in preflight response.

i am using cors_plug

in my endpoint file
plug CORSPlug, origin: “*”
plug CorpWeb.Router

i am not able to find what i am missing.

It seems you haven’t allowed the apitoken header. Try explictly allowing the header: plug CORSPlug, origin: ”*”, headers: [”apitoken”].

I have never used CORSPlug myself, so I hope it works.

1 Like

I use Corsica and the syntax is

plug Corsica, origins: "http://localhost:8080", allow_headers: :all

I don’t know about cors plug, but it seems You are missing the headers part.