Parcourir la source

refactor: remove prop

pull/604/head
Andrea PIERRÉ il y a 3 ans
Parent
révision
5f5fff3123
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 78A39B4A078E6C06
2 fichiers modifiés avec 9 ajouts et 12 suppressions
  1. +4
    -6
      packages/lesspass-pure/src/components/MasterPassword.vue
  2. +5
    -6
      packages/lesspass-pure/src/views/Login.vue

+ 4
- 6
packages/lesspass-pure/src/components/MasterPassword.vue Voir le fichier

@@ -64,11 +64,10 @@
<input
class="form-check-input"
type="checkbox"
id="flexSwitchCheckChecked"
v-bind:disabled="email === ''"
id="checkPlainPassword"
/>
<label class="form-check-label" for="flexSwitchCheckChecked">{{
PlainCheckboxText
<label class="form-check-label" for="checkPlainPassword">{{
$t("Use plain password")
}}</label>
</div>
</small>
@@ -89,8 +88,7 @@ export default {
type: Boolean,
default: false
},
EncryptButtonText: String,
PlainCheckboxText: String
EncryptButtonText: String
},
data() {
return {


+ 5
- 6
packages/lesspass-pure/src/views/Login.vue Voir le fichier

@@ -37,7 +37,6 @@
v-bind:email="email"
v-bind:showEncryptButton="true"
v-bind:EncryptButtonText="$t('Encrypt my master password')"
v-bind:PlainCheckboxText="$t('Use plain password')"
></master-password>
</div>
<div class="form-group">
@@ -77,10 +76,10 @@ import User from "../api/user";
import { defaultbaseURL } from "../api/default";
import MasterPassword from "../components/MasterPassword.vue";
import message from "../services/message";

import LessPass from "lesspass";
import defaultPasswordProfile from "../store/defaultPassword";
function encryptPass(email, password) {

function encryptPassword(email, password) {
return LessPass.generatePassword(
"lesspass.com",
email,
@@ -118,9 +117,9 @@ export default {
if (this.formIsValid()) {
const baseURL = this.baseURL;
this.$store.dispatch("setBaseURL", { baseURL });
let pass = encryptPass(this.email, this.password)
.then(pass => {
pass = document.getElementById("flexSwitchCheckChecked").checked ? this.password : pass;
encryptPassword(this.email, this.password)
.then(encryptedPassword => {
let pass = document.getElementById("checkPlainPassword").checked ? this.password : encryptedPassword;
User.login({ email: this.email, password: pass })
.then(response => {
this.$store.dispatch("login", response.data);


Chargement…
Annuler
Enregistrer