Basic Auth with Creator


#1

Ionic masters, please help!

Working on a group final project for our full stack boot camp and
we are having the dumbest issue on our registration/login pages.

When we add {{data}} as a

element, it displays all of the correct data in the
array but doesn’t seem to pass it to the ionic-auth. It’s installed thru the add-ons,
code was copied and modified to match our app id, ect… from creator-weekly-workshops

Login Code:


function ($scope, $stateParams, $ionicAuth, $ionicUser, $state) {
    
    $scope.data = {
        'name': '',
        'email': '',
        'password': ''
    }
    
    $scope.error='';

    $scope.signup = function(){
        
        $scope.error = '';

        $ionicAuth.signup($scope.data).then(function() {
            // `$ionicUser` is now registered
            $ionicAuth.login('basic', $scope.data).then(function(){
              $state.go('tabsController.home');
            });
        }, function(err) {
            
            var error_lookup = {
                'required_email': 'Missing email field',
                'required_password': 'Missing password field',
                'conflict_email': 'A user has already signed up with that email',
                'conflict_username': 'A user has already signed up with that username',
                'invalid_email': 'The email did not pass validation'
            }    
        
            $scope.error = error_lookup[err.details[0]];
        });
    }

}

#2

I’m now pro, but I got this working.

So Just eliminating the basics’ have you changed the app id?


#3

Yes. The app id is correct.


#4

The only other thing I can think of is making sure the .data names in the input component are the same as the controller eg data.email

I accidentally had a typo in one that caused it to fail.


#5

Have you checked the inspector ?
I have the same problem and in the inspector there is a network error saying that the APP can not be found.
Same as what you have, app ID is correct but for some reason ionic can not find it.

Did you manage to solve that ?