Fix redirect after login
This commit is contained in:
@@ -37,9 +37,16 @@ export default class Login extends Vue {
|
||||
})
|
||||
|
||||
if(this.logginIn) {
|
||||
if(userNotAuthorized)
|
||||
this.$router.push('/production')
|
||||
|
||||
if(userNotAuthorized){
|
||||
// If not authorized redirect to the first available page
|
||||
for(var k in this.URLS_TO_FUNCTIONS_BINDING){
|
||||
if(machineStatusActions.isAreaVisible(store, this.URLS_TO_FUNCTIONS_BINDING[k])){
|
||||
this.$router.push(this.URLS_TO_FUNCTIONS_BINDING[k])
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ModalHelper.HideModal("modal-login");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import { baseRestService, AuthToken, to } from "src/_base/baseRestService";
|
||||
import Factory from "src/_base/factoryService";
|
||||
import { store, appModelActions,machineStatusActions } from "src/store";
|
||||
import { store, appModelActions, machineStatusActions } from "src/store";
|
||||
import { machineService } from "./machineService";
|
||||
import {Hub} from "src/services/hub"
|
||||
|
||||
@@ -9,8 +9,6 @@ import {Hub} from "src/services/hub"
|
||||
class LoginService extends baseRestService {
|
||||
|
||||
public isAuthenticated: boolean = false;
|
||||
$route: any;
|
||||
$router: any;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user