From 0ad2ebe8f3c6bda100d686b3ce973bf5302b1424 Mon Sep 17 00:00:00 2001 From: Rajshekar Chavakula Date: Fri, 1 Mar 2024 17:21:24 +0530 Subject: [PATCH] variable name change to maintain consistency Signed-off-by: Rajshekar Chavakula --- backend/apid/routers/users.go | 2 +- backend/apid/routers/users_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/apid/routers/users.go b/backend/apid/routers/users.go index 69714eaff..9a200a120 100644 --- a/backend/apid/routers/users.go +++ b/backend/apid/routers/users.go @@ -168,7 +168,7 @@ func (r *UsersRouter) changePasswordFromWeb(req *http.Request) (interface{}, err if err != nil { return nil, err } - newPassword := params["newPassword"] + newPassword := params["password_new"] oldPassword := params["password"] user, err := r.controller.AuthenticateUser(req.Context(), username, oldPassword) diff --git a/backend/apid/routers/users_test.go b/backend/apid/routers/users_test.go index 30c754fa4..039e3cf9f 100644 --- a/backend/apid/routers/users_test.go +++ b/backend/apid/routers/users_test.go @@ -239,7 +239,7 @@ func TestUsersRouter(t *testing.T) { name: "update password from web ui", method: http.MethodPut, path: path.Join(fixture.URIPath(), "change_password"), - body: []byte(`{"username":"foo","password":"admin123","newPassword":"admin123"}`), + body: []byte(`{"username":"foo","password":"admin123","password_new":"admin123"}`), controllerFunc: func(c *mockUserController) { c.On("AuthenticateUser", mock.Anything, mock.Anything, mock.Anything). Return(&corev2.User{Username: "foo", Password: "admin123", PasswordHash: "admin123_hash"}, nil).