diff --git a/src/_services/user.service.js b/src/_services/user.service.js index 0668bce..29fdbf4 100644 --- a/src/_services/user.service.js +++ b/src/_services/user.service.js @@ -33,13 +33,14 @@ function setSessionUser (user) { return user; } -function login(name, password, messages, errors) { +function login(name, password, unlockKey, messages, errors) { + const unlockParam = (typeof unlockKey !== 'undefined' && unlockKey !== null) ? `?k=${unlockKey}` : ''; const requestOptions = { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ 'name': name, 'password': password }) }; - return fetch(`${config.apiUrl}/auth/login`, requestOptions) + return fetch(`${config.apiUrl}/auth/login${unlockParam}`, requestOptions) .then(handleAuthResponse(messages, errors)) .then(setSessionUser); } diff --git a/src/_store/account.module.js b/src/_store/account.module.js index 429f2dd..1f45416 100644 --- a/src/_store/account.module.js +++ b/src/_store/account.module.js @@ -38,11 +38,15 @@ const actions = { }, login({ dispatch, commit }, { user, messages, errors }) { commit('loginRequest', { name: user.name }); - userService.login(user.name, user.password, messages, errors) + userService.login(user.name, user.password, user.unlockKey, messages, errors) .then( user => { commit('loginSuccess', user); if (user.token) { + if (user.unlockKey) { + console.log('account.login: reloading system configs after unlock'); + dispatch('system/loadSystemConfigs'); + } const landing = util.getLandingPage(); if (landing === null) { router.replace('/'); diff --git a/src/_store/system.module.js b/src/_store/system.module.js index 115b58d..a4065ae 100644 --- a/src/_store/system.module.js +++ b/src/_store/system.module.js @@ -16,6 +16,7 @@ const state = { searchResults: [], status: { activating: false, searching: false, creatingEntity: false, modelSetupInProgress: false }, activated: null, + locked: null, error: null, messages: { durationToMillis: function(count, units) { diff --git a/src/account/NetworkPage.vue b/src/account/NetworkPage.vue index 8727eba..c4dd535 100644 --- a/src/account/NetworkPage.vue +++ b/src/account/NetworkPage.vue @@ -74,6 +74,7 @@