Christoph
Christoph
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
NextAuth only offers a library for Next.js, true. Services usually offer libraries for multiple languages.
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
Nothing wrong with implementing it yourself to understand it. But the deeper you go the more complex it gets.
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
Use a service (Clerk, Firebase, Auth0, ...) or a library (NextAuth, Lucia, ...)
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
Yep, that's the mistake. Check the docs for bcrypt.compare. Should be self-explanatory.
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
Btw. probably not the best idea to implement authentication yourself.
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
compare takes the plaintext password as an input, not a hash. You compare the input to the hash stored in the database.
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
How did you compare?
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
Reason being that configuration data and the salt is stored with the hash.
20 replies
TTCTheo's Typesafe Cult
Created by Revaycolizer on 8/31/2023 in #questions
Implementing login with Prisma
You hash the input and compare it with your hash in your database. Modern hash algorithms come with special functions to compare the hash to a value.
20 replies
TTCTheo's Typesafe Cult
Created by Ducky Sensei on 8/30/2023 in #questions
Prisma/Planetscale issue
Of course can use JSON or blob or w/e - but an extra table makes it easier to query the data.
10 replies
TTCTheo's Typesafe Cult
Created by Ducky Sensei on 8/30/2023 in #questions
Prisma/Planetscale issue
That's the way it's usually done.
10 replies
TTCTheo's Typesafe Cult
Created by Ducky Sensei on 8/30/2023 in #questions
Prisma/Planetscale issue
Usually a bad idea. Normalize your data unless you have a reason not to.
10 replies