generatePasswordHash static method
Generates a password hash from a users password and email. This value can safely be stored in the database without the risk of exposing passwords.
Implementation
static String generatePasswordHash(String password, String email) {
var salt = Serverpod.instance!.getPassword('email_password_salt') ??
'serverpod password salt';
if (AuthConfig.current.extraSaltyHash) {
salt += ':$email';
}
return sha256.convert(utf8.encode(password + salt)).toString();
}