HOW to handle authentification on a nextjs app with an external backend (NestJS)
Unanswered
Black-tailed Gnatcatcher posted this in #help-forum
Black-tailed GnatcatcherOP
Title says it, I have a NestJS Backend API that has signin/signup routes, how can I handle the authentification on the Next side ? I've been through next-auth credentials but haven't figured out how to make it work with my case.
What is the best practice in my case ?
What is the best practice in my case ?
10 Replies
@Zepeto Can you show us the code ?
Black-tailed GnatcatcherOP
I have a regular NestJS API that let's me signup/signin and returns a JWT on signin in the json response. Am mainly asking what is the best way to make it work and handle authorization on the NextJS side
what are best practices and how to make it work with my backend
@Zepeto Next-auth is a good solution for this
Black-tailed GnatcatcherOP
is there a place where I can see how to implement it for my use-case ? I've read the docs but cannot find the right one for the app router
Black-tailed GnatcatcherOP
thanks I'll look into it
@Black-tailed Gnatcatcher thanks I'll look into it
So does it work?
@Zepeto So does it work?
Black-tailed GnatcatcherOP
am still following the end of the tutorial, but have figured out how to get next-auth to kind of work yes! Thanks a lot