Commit 059f199d authored by Evren Kutar's avatar Evren Kutar

location replace

clear wf for login
parent 0fee5ee8
...@@ -8,14 +8,10 @@ ...@@ -8,14 +8,10 @@
'use strict'; 'use strict';
var auth = angular.module('zaerp.auth', ['ngRoute', 'schemaForm', 'ngCookies', 'general']); var auth = angular.module('zaerp.auth', ['ngRoute', 'schemaForm', 'ngCookies', 'general']);
auth.controller('LoginCtrl', function ($scope, $rootScope, $q, $timeout, $routeParams, Generator, LoginService) { auth.controller('LoginCtrl', function ($scope, $q, $timeout, $routeParams, Generator, LoginService) {
$scope.url = 'simple_login'; $scope.url = 'simple_login';
var form_params = {}; var form_params = {};
if ($rootScope.loginwfclear){ form_params['clear_wf'] = 1;
form_params['clear_wf'] = 1;
} else{
$rootScope.loginwfclear = 1
}
// todo: change simple login when api ready // todo: change simple login when api ready
Generator.get_form($scope.url, form_params).then(function(data){ Generator.get_form($scope.url, form_params).then(function(data){
var d = data.data.forms; var d = data.data.forms;
......
...@@ -26,11 +26,10 @@ app.config(['$httpProvider', function ($httpProvider) { ...@@ -26,11 +26,10 @@ app.config(['$httpProvider', function ($httpProvider) {
//Will only be called for HTTP up to 300 //Will only be called for HTTP up to 300
if(response.data.is_login===true){ if(response.data.is_login===true){
$rootScope.loggedInUser = response.data.is_login; $rootScope.loggedInUser = response.data.is_login;
if($location.path()==="/login"){ $location.replace();
$location.path('/dashboard'); //if($location.path()==="/login"){
} else{ // $location.path("/dashboard");
$location.replace(); //}
}
} }
if(response.data.screen) { if(response.data.screen) {
$location.path(response.data.screen); $location.path(response.data.screen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment