ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Ionic Custom Auth with inAppBrowser hidden doesnt fire error callback on 401

Open rgecy opened this issue 10 years ago • 1 comments

When using Ionic Auth with custom authentication, and hiding the inAppBrowser to use Ionic forms vs web forms, the error callback is not firing when the auth script returns a 401 error.

    var loginOptions = {'inAppBrowserOptions': {'hidden': true}};
    $ionicAuth.login('custom', userLogin, loginOptions).then(function (data) {
        Alert.showAlert('Success',JSON.stringify(data));
    },function(err){
        Alert.showAlert('Failed:',JSON.stringify(err));
    });

The ionic cloud docs do not go into error handling, but according to the examples given, the auth script should return a 401 error along with an error and code. I wanted to use my forms from the app and according to the docs could do so by hiding the inAppBrowser and receiving the error message through the error callback function.

https://forum.ionicframework.com/t/ionic-custom-auth-not-working-on-fail/63830

Ionic version 1.3.1 Android

Your system information:

Cordova CLI: 6.3.0 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 1.3.1 Ionic CLI Version: 2.0.0 Ionic App Lib Version: 2.0.0 OS: Windows 7 SP1 Node Version: v4.4.7

rgecy avatar Sep 21 '16 05:09 rgecy

This issue was moved to driftyco/ionic-cloud-issues#189

jgw96 avatar Sep 22 '16 16:09 jgw96