Browse Source

Return encrypted password profile

pull/567/head
Bianca Rosa 4 years ago
parent
commit
759af00adc
No known key found for this signature in database GPG Key ID: A5551D6B3C1EBA55
4 changed files with 13 additions and 2 deletions
  1. +1
    -1
      containers/backend/api/views.py
  2. +3
    -0
      packages/lesspass-pure/src/api/profile.js
  3. +8
    -0
      packages/lesspass-pure/src/store/actions.js
  4. +1
    -1
      packages/lesspass-pure/src/views/Login.vue

+ 1
- 1
containers/backend/api/views.py View File

@@ -29,7 +29,7 @@ class EncryptedPasswordProfilesViewSet(viewsets.ModelViewSet):
)

def get_queryset(self):
return models.EncryptedPasswordProfile.objects.filter(user=self.request.user)
return models.EncryptedPasswordProfiles.objects.filter(user=self.request.user)


class BackwardCompatibleTokenObtainPairView(TokenObtainPairView):


+ 3
- 0
packages/lesspass-pure/src/api/profile.js View File

@@ -1,6 +1,9 @@
import http from "./http";

export default {
all() {
return http.get("/api/encrypted_password_profiles/");
},
create(resource) {
return http.post("/api/encrypted_password_profiles/", resource);
},


+ 8
- 0
packages/lesspass-pure/src/store/actions.js View File

@@ -1,4 +1,5 @@
import Password from "../api/password";
import Profile from "../api/profile";
import * as urlParser from "../services/url-parser";
import * as types from "./mutation-types";
import defaultPasswordProfile from "./defaultPassword";
@@ -42,6 +43,13 @@ export const logout = ({ commit }) => {
};

export const getPasswords = ({ commit }) => {
Profile.all().then(response => {
let encryptedProfiles = response.data.results;
if (encryptedProfiles.length > 0) {
encryptedProfiles = encryptedProfiles[0];
console.log(encryptedProfiles.password_profile);
}
});
return Password.all()
.then(response => {
commit(types.LOGIN);


+ 1
- 1
packages/lesspass-pure/src/views/Login.vue View File

@@ -142,7 +142,7 @@ export default {
Profile.create({
password_profile: encryptedPasswordProfiles
});
// User.patch({ encrypted_key });
User.patch({ encrypted_key });
});
});
} else {


Loading…
Cancel
Save