diff --git a/CHANGELOG b/CHANGELOG index 1b98df96e32ad596bff153a67d670a4eefa27f78..561c3f7e821ed012b6ecf7ddac21ce753637641b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,8 @@ Changelog 0.6 (Unreleased) ---------------- +- Always use username in sidebar (#89) + 0.5.2 (2018-02-26) ------------------ diff --git a/front/src/store/auth.js b/front/src/store/auth.js index 24dafcd7266d7fe23f2e0c60807ea29fb440db98..7944cae0836f58a6eed111b2134fb9ab702123ef 100644 --- a/front/src/store/auth.js +++ b/front/src/store/auth.js @@ -89,6 +89,7 @@ export default { logger.default.info('Successfully fetched user profile') let data = response.data commit('profile', data) + commit('username', data.username) dispatch('favorites/fetch', null, {root: true}) Object.keys(data.permissions).forEach(function (key) { // this makes it easier to check for permissions in templates diff --git a/front/test/unit/specs/store/auth.spec.js b/front/test/unit/specs/store/auth.spec.js index aa07f9f8bfc03c5f2c766f4a333ff233058ace39..3271f5168f335a95f5e2799007bd3ec64cf77155 100644 --- a/front/test/unit/specs/store/auth.spec.js +++ b/front/test/unit/specs/store/auth.spec.js @@ -176,6 +176,7 @@ describe('store/auth', () => { action: store.actions.fetchProfile, expectedMutations: [ { type: 'profile', payload: profile }, + { type: 'username', payload: profile.username }, { type: 'permission', payload: {key: 'admin', status: true} } ], expectedActions: [