Sfoglia il codice sorgente

Change root url used in the copy password profile button

tags/site-v9.3.1
Guillaume Vincent 2 anni fa
parent
commit
07e23d8a17
3 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. +1
    -1
      packages/lesspass-pure/package.json
  2. +2
    -1
      packages/lesspass-pure/src/store/getters.js
  3. +2
    -2
      packages/lesspass-pure/tests/unit/store/getters.spec.js

+ 1
- 1
packages/lesspass-pure/package.json Vedi File

@@ -1,6 +1,6 @@
{
"name": "lesspass-pure",
"version": "9.5.2",
"version": "9.5.3",
"description": "LessPass web component",
"license": "GPL-3.0",
"author": "Guillaume Vincent <guillaume@oslab.fr>",


+ 2
- 1
packages/lesspass-pure/src/store/getters.js Vedi File

@@ -7,7 +7,8 @@ export const isGuest = state => !state.isAuthenticated;
export const passwordURL = state => {
const base64PasswordProfile = btoa(JSON.stringify(state.password));
const encodedPasswordProfile = encodeURIComponent(base64PasswordProfile);
return `${state.settings.baseURL}/#/?passwordProfileEncoded=${encodedPasswordProfile}`;
const wwwBaseUrl = state.settings.baseURL.replace('api.', 'www.');
return `${wwwBaseUrl}/#/?passwordProfileEncoded=${encodedPasswordProfile}`;
};

export const shouldAutoFillSite = state => !state.settings.noAutoFillSite;


+ 2
- 2
packages/lesspass-pure/tests/unit/store/getters.spec.js Vedi File

@@ -19,7 +19,7 @@ test("passwordURL", () => {
};

expect(getters.passwordURL(state)).toBe(
"https://api.lesspass.com/#/?passwordProfileEncoded=eyJsb2dpbiI6InRlc3RAZXhhbXBsZS5vcmciLCJzaXRlIjoiZXhhbXBsZS5vcmciLCJ1cHBlcmNhc2UiOnRydWUsImxvd2VyY2FzZSI6dHJ1ZSwibnVtYmVycyI6dHJ1ZSwic3ltYm9scyI6ZmFsc2UsImxlbmd0aCI6MTYsImNvdW50ZXIiOjEsInZlcnNpb24iOjJ9"
"https://www.lesspass.com/#/?passwordProfileEncoded=eyJsb2dpbiI6InRlc3RAZXhhbXBsZS5vcmciLCJzaXRlIjoiZXhhbXBsZS5vcmciLCJ1cHBlcmNhc2UiOnRydWUsImxvd2VyY2FzZSI6dHJ1ZSwibnVtYmVycyI6dHJ1ZSwic3ltYm9scyI6ZmFsc2UsImxlbmd0aCI6MTYsImNvdW50ZXIiOjEsInZlcnNpb24iOjJ9"
);
});

@@ -34,7 +34,7 @@ test("passwordURL encode uri component", () => {
};

expect(getters.passwordURL(state)).toBe(
"https://api.lesspass.com/#/?passwordProfileEncoded=eyJsb2dpbiI6ImNvbnRhY3RAbGVzc3Bhc3MuY29tIn0%3D"
"https://www.lesspass.com/#/?passwordProfileEncoded=eyJsb2dpbiI6ImNvbnRhY3RAbGVzc3Bhc3MuY29tIn0%3D"
);
});



Caricamento…
Annulla
Salva