Browse Source

Fix profile replaced if no site

fix https://github.com/lesspass/lesspass/issues/254
pull/342/head
Guillaume Vincent 7 years ago
parent
commit
2aee8461f2
7 changed files with 42 additions and 10 deletions
  1. +3
    -3
      dist/lesspass.min.js
  2. +2
    -2
      package.json
  3. +3
    -1
      src/store/actions.js
  4. +2
    -3
      src/views/Login.vue
  5. +5
    -1
      test/e2e/nightwatch.conf.js
  6. +1
    -0
      test/e2e/specs/loginLogout.js
  7. +26
    -0
      test/e2e/specs/useSavedProfile.js

+ 3
- 3
dist/lesspass.min.js
File diff suppressed because it is too large
View File


+ 2
- 2
package.json View File

@@ -48,7 +48,7 @@
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-register": "^6.24.1",
"chromedriver": "^2.30.1",
"chromedriver": "^2.31.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^5.0.1",
"css-loader": "^0.28.4",
@@ -69,7 +69,7 @@
"vue-polyglot-utils": "^0.1.1",
"vue-template-compiler": "^2.4.2",
"walk": "^2.3.9",
"webpack": "^3.3.0",
"webpack": "^3.4.1",
"webpack-dev-server": "^2.6.1"
},
"ava": {


+ 3
- 1
src/store/actions.js View File

@@ -22,7 +22,9 @@ export const passwordGenerated = ({ commit }) => {

export const loadBestPasswordProfile = ({ commit }) => {
urlParser.getSite().then(site => {
commit(types.LOAD_PASSWORD_PROFILE, { site });
if (site) {
commit(types.LOAD_PASSWORD_PROFILE, { site });
}
});
};



+ 2
- 3
src/views/Login.vue View File

@@ -14,7 +14,6 @@
<i class="fa fa-globe"></i>
<input id="baseURL"
class="form-control"
type="text"
autocapitalize="none"
v-bind:placeholder="$t('LessPass Database Url')"
v-model="baseURL">
@@ -45,7 +44,7 @@
</div>
<div class="form-group row no-gutters mb-0">
<div class="col">
<button id="signInButton" class="btn btn-block" type="submit"
<button id="signInButton" class="btn btn-block"
v-bind:class="{ 'btn-warning': version===1, 'btn-primary': version===2 }">
{{$t('Sign In')}}
</button>
@@ -102,7 +101,7 @@
.catch(err => {
if (err.response === undefined && baseURL !== "https://lesspass.com") {
message.error(this.$t('DBNotRunning', 'Your LessPass Database is not running'));
} else if (err.response.status === 400) {
} else if (err.response && err.response.status === 400) {
message.error(this.$t('LoginIncorrectError', 'The email and password you entered did not match our records. Please double-check and try again.'));
} else {
message.displayGenericError();


+ 5
- 1
test/e2e/nightwatch.conf.js View File

@@ -15,15 +15,19 @@ module.exports = {
waitForConditionTimeout: 5000
},
desiredCapabilities: {
browserName: "chrome",
browserName: "chrome"
/*
chromeOptions: {
args: [
"--headless",
"--no-sandbox",
"--disable-gpu",
"--allow-running-insecure-content",
"--ignore-certificate-errors",
"--window-size=1920x1080"
]
}
*/
}
}
}


+ 1
- 0
test/e2e/specs/loginLogout.js View File

@@ -4,6 +4,7 @@ module.exports = {
"Login logout tests": function(browser) {
browser
.url(browser.launch_url)
.pause(1000)
.waitForElementVisible(".fa-sign-in")
.click(".fa-sign-in")
.waitForElementVisible("#baseURL")


+ 26
- 0
test/e2e/specs/useSavedProfile.js View File

@@ -0,0 +1,26 @@
var assert = require("assert");

module.exports = {
"Login logout tests": function(browser) {
browser
.url(browser.launch_url)
.pause(1000)
.waitForElementVisible(".fa-sign-in")
.click(".fa-sign-in")
.setValue("#email", "test@lesspass.com")
.setValue("#passwordField", "test@lesspass.com")
.waitForElementVisible("#encryptMasterPassword__btn")
.click("#encryptMasterPassword__btn")
.waitForElementVisible("#signInButton")
.click("#signInButton")
.waitForElementVisible(".fa-key")
.click(".fa-key")
.waitForElementVisible(".passwordProfile__site")
.click(".passwordProfile__site")
.waitForElementVisible("#site")
.assert.value("#site", "example.org")
.assert.value("#login", "contact@example.org");

browser.end();
}
};

Loading…
Cancel
Save