NextAuth password migration
I'm currently migrating from NextAuth. Is it possible to retain the existing passwords or otherwise customize the password hashing process?
how to handle password migration ?
6 Replies
@parweb do you got the solution?
Kinda, I didn’t implement it yet, but the gist of it is to override the hashing function of better auth
what about migrating passwords?
next auth store password in user table but better auth in credential
you can copy the password hash to where better auth expects it to be. And you can implement custom password hashing, if it's not scrypt or you have different configuration.
@bekacru I wrote this migration script, I have 190 users. so just need you to verify the code:
I tested it works, but just to double check. I have updated the has fn;
does it feel ok to you?