1LimoLabsAutoCabApp.controller('LoginController', ['$rootScope', '$scope', 'AuthService', 'UsersService', 'EVENTS', '$state', 'CONFIG', 'TRANSLATION', 'toastr', 2 function ($rootScope, $scope, Auth, Users, EVENTS, $state, CONFIG, TRANSLATION, toastr) { 3 4 if (Auth.hasIdentity()) { 5 $state.go('booking.widget'); 6 return; 7 } 8 9 $scope.incorrectUsernamePassword = false; 10 11 $scope.login = function (customer) { 12 13 if (!angular.isDefined(customer)) { 14 $scope.incorrectUsernamePassword = true; 15 } 16 17 Auth.authenticate(customer.username, customer.password).then(function (identity) { 18 toastr.success('You have successfully logged in', TRANSLATION.success_title); 19 $scope.incorrectUsernamePassword = false; 20 $rootScope.sendEventToLimoLabsLoginWidget(EVENTS.BOOKING_WIDGET_LOGGED_IN); 21 22 if (CONFIG.force_login_go_to_checkout) { 23 $state.go('booking.checkout'); 24 } else { 25 $state.go('booking.select-vehicle'); 26 } 27 }).catch(function (err) { 28 toastr.warning(err.message || 'Invalid credentials', TRANSLATION.warning_title); 29 $scope.incorrectUsernamePassword = true; 30 }); 31 }; 32 33 $scope.showRegister = function () { 34 $state.go('admin.register'); 35 }; 36 37 $scope.sendForgotPasswordRequest = function (email) { 38 Users.recoveryStart(email).then(function (response) { 39 toastr.success('Please check your email for instructions', TRANSLATION.success_title); 40 }); 41 }; 42 } 43]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.