How to verify that a user is currently authenticated on a separate non-JS API endpoint? #11738
Unanswered
mariomeissner
asked this question in
Help
Replies: 1 comment 3 replies
-
I did find https://authjs.dev/guides/integrating-third-party-backends but two things confuse me:
Nonetheless, the client code does have some sort of token for Auth.js to verify whether client code is authenticated, so there must be a way to use that instead. I read in https://authjs.dev/concepts/session-strategies that there is a cookie value for this. Should I read that cookie and add it to the request to my other API endpoint? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a NextJS app router project with Auth.js v5 using the database session strategy. I also have a separate Python REST API endpoint. I want to verify that the requests to that API are coming from authenticated users only. The requests would come from a client component. I understand that I should pass some sort of token to the API call and then check whether the user has an active session in the database. However, I don't know which token to pass and how to obtain it. Could I get some guidance on that?
Beta Was this translation helpful? Give feedback.
All reactions