migrating from supabase auth how are passwords handled?
Hi, I'm using supabase auth currently and I'm wondering how the passwords are handled when migrating as supabase uses bcrypt to hash passwords but I believe better-auth uses scrypt? So how does that work? Do I need to support both bcrypt + scrypt such that when users login I'll need to check both bcrypt and scrypt and overtime only support scrypt once all (or most) users have signed in again?
4 Replies
Did you manage to get this working?
I didn’t migrate yet, but it’s doable you just need to modify the login password verification function to check if it’s encrypted with bcrypt or not. If it is and they login then rehash it to scrypt to store in the database.
Okay i'll give it a go.
Found a better way: https://www.better-auth.com/docs/authentication/email-password#configuration
This way you can continue using bcrypt
Email & Password | Better Auth
Implementing email and password authentication with Better Auth.