CORS issue when calling my external API in Auth0 action-trigger

Ready to post? :mag: First, try searching for your answer.
I currently have a post-login trigger action so that if a user is logging in for the first time, it makes a call to my external Node/Express API so that I can add some user information to my database.

My problem is that my server won’t accept any calls coming from Auth0 and I believe I see some CORS errors, but I have whitelisted my Auth0 tenant domain in my CORS so I believe it should work. Any help would be appreciated!

This is what my action-trigger looks like right now.

Hi @azhhng

you need to add secrets in the post logins i.e to access your database and redeploy the post login and you need to express you db connection in your code for reference like below screen shot

i hope this might help you

Hey @yellowblockllp, thanks for the suggestion but I am trying to call an endpoint on my external API which will access my database for me so I don’t have to directly call the database in Auth0! The problem is accessing my API from the Auth0 action trigger isn’t working for me

I figured out my issue, and now it’s working!

For my CORS configuration in my server, I was not letting requests pass that did not contain an origin, which I guess Auth0 sometimes doesn’t send an origin when making requests, which is why it was getting blocked.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.