Replace bcrypt with Argon2

This commit is contained in:
eikendev 2020-07-27 21:48:41 +02:00
parent 0b871b2136
commit d8b62f1b80
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
5 changed files with 25 additions and 11 deletions

View file

@ -41,7 +41,7 @@ func NewUser(name, password string, isAdmin bool, matrixID string) *User {
user := User{
Name: name,
PasswordHash: credentials.CreatePassword(password),
PasswordHash: credentials.CreatePasswordHash(password),
IsAdmin: isAdmin,
MatrixID: matrixID,
}
@ -53,7 +53,7 @@ func NewUser(name, password string, isAdmin bool, matrixID string) *User {
func (u *ExternalUserWithCredentials) IntoInternalUser() *User {
return &User{
Name: u.Name,
PasswordHash: credentials.CreatePassword(u.Password),
PasswordHash: credentials.CreatePasswordHash(u.Password),
IsAdmin: u.IsAdmin,
MatrixID: u.MatrixID,
}