Giter Club home page Giter Club logo

Comments (3)

wallstudios avatar wallstudios commented on July 17, 2024

ok, I can get it working but thought I would see if you can recommend a better option.

I've added an additional callback function in your factory and included $rootScope

  retryAll: function(updater) {

    for (var i = 0; i < buffer.length; ++i) {
      retryHttpRequest(updater(buffer[i].config), buffer[i].deferred);
      $rootScope.$broadcast('event:auth-retryAll');
    }
    buffer = [];
  }

        $scope.$on('event:auth-retryAll', function() {
            $ionicLoading.show({template: '<ion-spinner icon="ripple"/>'});
        });

from angular-http-auth.

witoldsz avatar witoldsz commented on July 17, 2024

When you use this module and you request for some data and it returns a 401, then that response is intercepted by the module and you won't catch the 401 response, so your spinner should keep spinning and stop only when you have authorized and the retry operation succeeded.

Bottom line is: do not make your app to interrupt anything because of responses captured by this module. Just hide everything behind login panel and make this login panel disappears when it's done.

Your "spinner" logic should not know that the 401's ever happened.

from angular-http-auth.

wallstudios avatar wallstudios commented on July 17, 2024

I thought about that but I'm using ionic and the spinner ionicloading I'm using is made to go on top and and clicks are disabled etc.

The spinner itself does keep working I'm canceling it manually to show the login modal.

Might re visit it and see what I can do.

from angular-http-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.