Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (response.user.state == 'active') {
- $scope.isNewUser = 0;
- console.log('response.user.email ');
- console.log(response.user.email);
- $state.go('login.login' , {'prefillEmail': response.user.email});
- //
- }
- .state('login.login', {
- url: '/login',
- params: { redirect: { value: '' } },
- templateUrl: 'views/login.html',
- controller: 'loginCtrl',
- resolve: {
- redirect: function($stateParams) {
- return $stateParams.redirect;
- }
- }
- })
- (function () {
- 'use strict';
- angular.module('app')
- .controller('loginCtrl', function($scope, authService, redirect, $state, $location, $stateParams) {
- $scope.credentials = {
- email: '',
- password: ''
- };
- console.log('$stateParams');
- console.log($stateParams);
- console.log('$state');
- console.log($state);
- $scope.authenticate = function() {
- authService.login($scope.credentials)
- .then(function(response) {
- //Redirecting to hostname. Route check user type and return needed URL
- $location.path(redirect || '/');
- });
- }
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement