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

location replace

clear wf for login
parent 0fee5ee8
......@@ -8,14 +8,10 @@
'use strict';
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';
var form_params = {};
if ($rootScope.loginwfclear){
form_params['clear_wf'] = 1;
} else{
$rootScope.loginwfclear = 1
}
form_params['clear_wf'] = 1;
// todo: change simple login when api ready
Generator.get_form($scope.url, form_params).then(function(data){
var d = data.data.forms;
......
......@@ -26,11 +26,10 @@ app.config(['$httpProvider', function ($httpProvider) {
//Will only be called for HTTP up to 300
if(response.data.is_login===true){
$rootScope.loggedInUser = response.data.is_login;
if($location.path()==="/login"){
$location.path('/dashboard');
} else{
$location.replace();
}
$location.replace();
//if($location.path()==="/login"){
// $location.path("/dashboard");
//}
}
if(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