Replies: 1 comment
-
It might not be the best approach as you are sort of delegating the auth mechanism to the frontend (well the backend of the frontend, the nextjs serverless function) while your real backend is somewhere else. We also use spring boot but do things a bit differently:
|
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 💬
I am building a frontend with next.js right now, which authenticates with GitHub OAuth using next-auth.
Next-auth handles all the authentication including the session and saves all that into a database, in my case a Postgres DB.
I now also want to connect my frontend to a spring boot backend server via REST API, which handles some file access. I could simply include the session token into the authorization header and connect my backend to the Postgres DB also and check if a session with this token exists.
But this approach seems not right. What is the best way to secure my backend here? How can my backend check if the user is logged in with GitHub?
How to reproduce ☕️
Like mentioned above
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions