From 05d8eb5e5ae6ba1b5474a27371c5b9dc896e4e3d Mon Sep 17 00:00:00 2001 From: Lorian Coltof Date: Thu, 8 Sep 2022 15:56:36 +0200 Subject: [PATCH] Add field for new private key password when rotating user --- frontend/src/main.js | 5 ++++- frontend/static/index.html | 4 ++++ main.go | 10 +++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/frontend/src/main.js b/frontend/src/main.js index 8e0709f..b06a71e 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -192,6 +192,7 @@ new Vue({ newUserPrivateKeyPassword: '', newUserCreateError: '', newPassword: '', + newPrivateKeyPassword: '', passwordChangeStatus: '', passwordChangeMessage: '', rotateUserMessage: '', @@ -465,18 +466,20 @@ new Vue({ var data = new URLSearchParams(); data.append('username', user); data.append('password', _this.u.newPassword); + data.append('private-key-password', _this.u.newPrivateKeyPassword); axios.request(axios_cfg('api/user/rotate', data, 'form')) .then(function(response) { _this.u.roatateUserStatus = 200; _this.u.newPassword = ''; + _this.u.newPrivateKeyPassword = ''; _this.getUserData(); _this.u.modalRotateUserVisible = false; _this.$notify({title: 'Certificates for user ' + _this.username + ' rotated!', type: 'success'}) }) .catch(function(error) { _this.u.roatateUserStatus = error.response.status; - _this.u.rotateUserMessage = error.response.data.message; + _this.u.rotateUserMessage = error.response.data; _this.$notify({title: 'Rotate certificates for user ' + _this.username + ' failed!', type: 'error'}) }) }, diff --git a/frontend/static/index.html b/frontend/static/index.html index 227a9c4..7e6f164 100644 --- a/frontend/static/index.html +++ b/frontend/static/index.html @@ -196,6 +196,10 @@

Enter new password:

+