I am having issue configuring dynamic origin in cors config, does super token support this
d
I am having issue configuring dynamic origin in cors config, does super token support this
r
Hey! What’s the issue exactly?
d
something like this
app.use( cors({ origin: function (origin, callback) { if ([process.env.TOKEN_WEB_DOMAIN,process.env.TOKEN_WEB_DOMAIN_1 ].indexOf(origin) !== -1 || !origin) { callback(null, true) } else { callback(new Error('Not allowed by CORS')) }}, allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()], credentials: true }) )
r
And what error are you seeing?
d
nvm this was an issue with my setup.
r
Cool!