(function() {
    'use strict';
    angular.module('app.chat.authentication').controller('LoginController', LoginController);
    /* @ngInject */
    function LoginController($mdDialog, authenticationService, commonService, $stateParams,$state) {
        var vm = this;
        vm.data = {};
        vm.parameter = $stateParams.parameter;
        vm.loginClick = loginClick;
        vm.init = init;
        vm.activateUser = activateUser;

        function init() {
            if (angular.isDefined(vm.parameter)) {
                vm.activateUser();
            }
        }

        function activateUser() {
            authenticationService.getData('api','user','activate_user', vm.parameter).
            then(function(response) {
            })
        }

        function loginClick() {
            var postParam = vm.user
                // console.log(postParam);
            authenticationService.postData('login', postParam)
                .then(function(response) {
                    commonService.showToast(response.data.message);
                    commonService.setUserInfo(response.data.data);
                    if (response.data.status == '200') {
                        commonService.setUserPermission(true);
                         $state.go('home.profile');
                    }
                    console.log(response);
                })
        }

        vm.init();

    }
})();

@@ -230,16 +230,17 @@
 eParams,
+ 
 $state) 
@@ -657,15 +657,17 @@
 pi',
+ 
 'user',
+ 
 'act
@@ -724,32 +724,96 @@
 ion(response) %7B%0A
+                commonService.showToast(response.data.message);%0A
             %7D)%0A 
@@ -802,32 +802,33 @@
 ;%0A            %7D)
+;
 %0A        %7D%0A%0A    
@@ -1291,25 +1291,24 @@
 sion(true);%0A
- 
             

fix the login...