Logout instead of retry login with Primary Password

This commit is contained in:
Natsumi
2022-02-11 12:23:26 +13:00
parent bccfd2fd0c
commit d10f2c3882
2 changed files with 2 additions and 35 deletions

View File

@@ -5971,38 +5971,7 @@ speechSynthesis.getVoices();
}
return new Promise((resolve, reject) => {
if (this.enablePrimaryPassword) {
this.checkPrimaryPassword(loginParmas)
.then((pwd) => {
this.loginForm.loading = true;
return API.getConfig()
.catch((err) => {
this.loginForm.loading = false;
reject(err);
})
.then(() => {
API.login({
username: loginParmas.username,
password: pwd,
cipher: loginParmas.password
})
.catch((err2) => {
this.loginForm.loading = false;
API.logout();
reject(err2);
})
.then(() => {
this.loginForm.loading = false;
resolve();
});
});
})
.catch((_) => {
this.$message({
message: 'Incorrect primary password',
type: 'error'
});
reject(_);
});
API.logout();
} else {
API.getConfig()
.catch((err) => {
@@ -6017,11 +5986,9 @@ speechSynthesis.getVoices();
.catch((err2) => {
this.loginForm.loading = false;
API.logout();
reject(err2);
})
.then(() => {
this.loginForm.loading = false;
resolve();
});
});
}

View File

@@ -1132,7 +1132,7 @@ html
div.options-container
span.header Application
div.options-container-item
span.name Use a Primary Password
span.name(style="min-width:236px") Encrypt password (disables auto login)
el-switch(v-model="enablePrimaryPassword" @change="enablePrimaryPasswordChange" :disabled="!loginForm.savedCredentials[API.currentUser.username]")
div.options-container-item
span.name Start at Windows startup