This commit is contained in:
2021-06-16 00:02:41 +00:00
parent 0560e15cb3
commit 95bfd5295f
3 changed files with 11 additions and 2 deletions

View File

@@ -56,7 +56,8 @@ export function processLogin(authResponse, loggedInWithKnownPassword) {
roles: authResponse.roles,
userType: authResponse.usertype,
dlt: authResponse.dlt,
tfaEnabled: authResponse.tfa
tfaEnabled: authResponse.tfa,
customerRights: authResponse.customerRights
});
//log the login
window.$gz.store.commit(

View File

@@ -26,6 +26,7 @@ export default new Vuex.Store({
apiToken: "-",
downloadToken: "-",
tfaEnabled: undefined,
customerRights: {},
userId: 0,
userName: "NOT AUTHENTICATED",
roles: 0,
@@ -70,12 +71,16 @@ export default new Vuex.Store({
state.userType = data.userType;
state.downloadToken = data.dlt;
state.tfaEnabled = data.tfaEnabled;
if (data.customerRights) {
state.customerRights = data.customerRights;
}
},
logout(state) {
//Things that are reset on logout
state.apiToken = "-";
state.downloadToken = "-";
state.tfaEnabled = undefined;
state.customerRights = {};
state.authenticated = false;
state.userId = 0;
state.userName = "NOT AUTHENTICATED";

View File

@@ -1,5 +1,8 @@
<template>
<UnderConstruction data-cy="underconstruction" />
<div>
{{ $store.state.customerRights }}
<UnderConstruction data-cy="underconstruction" />
</div>
</template>
<script>