Hi guys :wave: I'm new to prisma, so sorry for suc...
# orm-help
d
Hi guys πŸ‘‹ I'm new to prisma, so sorry for such a basic question haha. I come from using django, where everything is handled for you, and so I'm not completely sure of what the best way of implementing user auth could be. Do you guys know of any resources that could help me? I know I have to create the user model, make sure passwords are hashed, implement sessions (or something like that) and etc BUT, as I said, I'm not sure because I am used to having something like django to handle all that for you.
n
Hey πŸ‘‹ With which framework are you using Prisma? With Next.js you can use Next Auth
d
Oh, cool! So I can use social authentication with prisma to make it all even easier. How would I go about password authentication tho? I'm guessing, because NextAuth makes it 10x easier, all I really have to do is use the credentials provider and hash the password when registering and etc etc, right?
I do see that NextAuth does discourage the use of credentials tho. I see its because of added complexity, but if most people use it then what's the issue? Do you think I should still go for it?
@Nurul
n
I would still recommend using NextAuth, it’s actively maintained and is quite popular. You could even ask Next Auth specific questions in their GitHub Discussions: https://github.com/nextauthjs/next-auth
d
Great! Thanks πŸ˜„
πŸ‘ 1
Hi @Nurul, was doing some investigating and it turns out you can't use the Credentials Provider with any adapter, which includes prisma. So basically, I can't have my users register/login with email/password. What other options do I have?
It really seems like NextAuth wants to avoid credentials auth as much as possible, as they themselves said in the docs. I guess NextAuth is something I can't use for what I need then.
m
What about this: https://github.com/vercel/next.js/tree/canary/examples/with-passport Using passport.js with the local strategy
n
If you want to try out some cloud auth offerings then Auth0, Supabase Auth, Firebase Auth are good. We have a blog on using Auth0 with Prisma which you can checkout here
d
Update: I ended up using iron-session to do the authentication and it works great. It doesn't require me to setup any jwt tokens and is really nice to work with. If I ever do need SocialAuthentication, I will probably try and use passportjs. It seems to have everything I need with only a little bit of extra work to setup. Thanks for the help guys!
πŸ‘ 1