diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-06-22 23:28:09 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-07-22 00:46:43 +0300 |
commit | 2c98b0954ac5c50ea9c77e9ee780e3dee4fcdad8 (patch) | |
tree | 32b795b008fcb81facc5138794efe83482534df6 /src/store/modules/Authentication/AuthenticanStore.js | |
parent | 9ccb8a9768d90376d33b37d817929b916f405042 (diff) | |
download | webui-vue-2c98b0954ac5c50ea9c77e9ee780e3dee4fcdad8.tar.xz |
Add check if password change required at Login
After successfully authenticating on the Login page, check
/redfish/v1/AccountService/Accounts/${username} endpoint for
the PasswordChangeRequired property to see whether or not the
password is expired. If the password is expired, then navigate
to the Change password page, if the password isn't expired
navigate to the Overview page.
After successfully changing an expired password, navigate to the
Overview page.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I32de5f71bcfcbe4099c2953a31c05ba0ebe670bc
Diffstat (limited to 'src/store/modules/Authentication/AuthenticanStore.js')
-rw-r--r-- | src/store/modules/Authentication/AuthenticanStore.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js index 407c2b57..4afb11de 100644 --- a/src/store/modules/Authentication/AuthenticanStore.js +++ b/src/store/modules/Authentication/AuthenticanStore.js @@ -43,6 +43,12 @@ const AuthenticationStore = { .then(() => commit('logout')) .then(() => router.go('/login')) .catch(error => console.log(error)); + }, + async checkPasswordChangeRequired(_, username) { + return await api + .get(`/redfish/v1/AccountService/Accounts/${username}`) + .then(({ data: { PasswordChangeRequired } }) => PasswordChangeRequired) + .catch(error => console.log(error)); } } }; |