What is the best way to handle auth?
Unanswered
Chinese Alligator posted this in #help-forum
Chinese AlligatorOP
What is the best way to handle auth in nextjs with a springboot backend handling the authentication?
9 Replies
http requests and http only cookies
American Chinchilla
The only issue is the sites will be crossed domain
Hence possibilty of csrf attack
Would need to use some anti csrf token along with content policy to prevent xss
Chinese AlligatorOP
But i mean more on a how can i get the user on the frontend, like by creating some hook or contexts? And if it is possible to get the im server components
@Chinese Alligator But i mean more on a how can i get the user on the frontend, like by creating some hook or contexts? And if it is possible to get the im server components
you can get the cookie in server component, send that over to your server to get user info
Chinese AlligatorOP
Should i just make a function or is there something else even better?
sure, make a function to abstract away the logic
Chinese AlligatorOP
Yeah, but im tring to add a callback url cookie too, but i can't edit cookies in server components