mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 12:32:11 +08:00
Password policy (#82268)
* add password service interface * add password service implementation * add tests for password service * add password service wiring * add feature toggle * Rework from service interface to static function * Replace previous password validations * Add codeowners to password service * add error logs * update config files --------- Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
@ -88,11 +88,11 @@ func (ss *SQLStore) createUser(ctx context.Context, sess *DBSession, args user.C
|
||||
usr.Rands = rands
|
||||
|
||||
if len(args.Password) > 0 {
|
||||
encodedPassword, err := util.EncodePassword(args.Password, usr.Salt)
|
||||
encodedPassword, err := util.EncodePassword(string(args.Password), usr.Salt)
|
||||
if err != nil {
|
||||
return usr, err
|
||||
}
|
||||
usr.Password = encodedPassword
|
||||
usr.Password = user.Password(encodedPassword)
|
||||
}
|
||||
|
||||
sess.UseBool("is_admin")
|
||||
|
Reference in New Issue
Block a user