Fetch secured API routes from outside of my app #4418
Unanswered
gielcobben
asked this question in
Help
Replies: 2 comments
-
Does the outside of your app mean a different origin? Doing so would be a violation of the same-origin policy, which is kind of outside the scope for NextAuth.js. |
Beta Was this translation helpful? Give feedback.
0 replies
-
One possible solution around that is to fetch the domain/api/auth/session endpoint. Replace : With :
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
Hi 👋 , I configured NextAuth and use the Google Provider to sign in. Everything works perfectly I was just wondering if it is possible to call an API route externally with Authorization through a Bearer Token or something like it. I would love to make secure calls from outside of the app (with fetch). Below is an example of a secured API route:
How to reproduce ☕️
/api/properties
:External fetch:
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions