From 463eb9872acc1297808aa4ed388649b1f4971aea Mon Sep 17 00:00:00 2001 From: tangcong Date: Thu, 9 Mar 2023 12:21:50 +0800 Subject: [PATCH] server/auth: fix auth panic bug when user changes password --- server/auth/store.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/auth/store.go b/server/auth/store.go index 40262c76d62b..11a663fc1186 100644 --- a/server/auth/store.go +++ b/server/auth/store.go @@ -493,11 +493,9 @@ func (as *authStore) UserChangePassword(r *pb.AuthUserChangePasswordRequest) (*p var password []byte var err error - if !user.Options.NoPassword { - password, err = as.selectPassword(r.Password, r.HashedPassword) - if err != nil { - return nil, ErrNoPasswordUser - } + password, err = as.selectPassword(r.Password, r.HashedPassword) + if err != nil { + return nil, ErrNoPasswordUser } updatedUser := &authpb.User{