Skip to content

Commit 2436d00

Browse files
committed
hides master password modal only on success response
1 parent 5127d5d commit 2436d00

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

pgmanage/app/static/assets/js/pgmanage_frontend/src/components/MasterPasswordModal.vue

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
id="password_check_button"
9898
type="button"
9999
class="btn btn-success"
100-
data-dismiss="modal"
101100
@click="checkMasterPassword"
102101
>
103102
Ok
@@ -142,7 +141,6 @@ export default {
142141
isNewPassword: false,
143142
passwordMessage:
144143
"Please provide your master password to unlock your connection credentials for this session.",
145-
masterPassConfirmed: true,
146144
};
147145
},
148146
computed: {
@@ -179,14 +177,10 @@ export default {
179177
this.$refs.masterPassCheckInput.focus();
180178
}
181179
});
182-
183-
$(this.$refs.masterPasswordModal).on("hidden.bs.modal", () => {
184-
if (!this.masterPassConfirmed) {
185-
this.showModal();
186-
}
187-
});
188180
},
189181
showModal() {
182+
this.passwordMessage =
183+
"Please provide your master password to unlock your connection credentials for this session.";
190184
$(this.$refs.masterPasswordModal).modal({
191185
backdrop: "static",
192186
keyboard: false,
@@ -198,27 +192,24 @@ export default {
198192
master_password: this.password,
199193
})
200194
.then(() => {
201-
this.$emit("checkCompleted")
195+
this.$emit("checkCompleted");
202196
showToast("success", "Master password created.");
203197
});
204198
},
205199
checkMasterPassword() {
206-
$(this.$refs.masterPasswordModal).modal("hide");
207200
axios
208201
.post("/master_password/", {
209202
master_password: this.checkPassword,
210203
})
211204
.then(() => {
212-
this.$emit("checkCompleted")
213-
this.masterPassConfirmed = true;
205+
$(this.$refs.masterPasswordModal).modal("hide");
206+
this.$emit("checkCompleted");
214207
})
215208
.catch((error) => {
216209
this.passwordMessage = error.response.data.data;
217-
this.masterPassConfirmed = false;
218210
});
219211
},
220212
resetPassword() {
221-
this.masterPassConfirmed = true;
222213
createMessageModal(
223214
`Are you sure you want to reset you master password?
224215
You will lose your saved connection passwords.`,

0 commit comments

Comments
 (0)