mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
auth: fix NoPassWord check when add user
This commit is contained in:
parent
9f81002a11
commit
aea34c14ca
@ -388,7 +388,8 @@ func (as *authStore) UserAdd(r *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse,
|
|||||||
var hashed []byte
|
var hashed []byte
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if r.Options != nil && !r.Options.NoPassword {
|
noPassword := r.Options != nil && r.Options.NoPassword
|
||||||
|
if !noPassword {
|
||||||
hashed, err = bcrypt.GenerateFromPassword([]byte(r.Password), as.bcryptCost)
|
hashed, err = bcrypt.GenerateFromPassword([]byte(r.Password), as.bcryptCost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if as.lg != nil {
|
if as.lg != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user