Giter Club home page Giter Club logo

Comments (7)

xeor avatar xeor commented on August 24, 2024

I'm currently using popup, which works fine with AngularJS.
I havent tried, but I dont think using redirect should be a problem with Angular, as long as you have the route in place..? Do you have more info? What did you try?

from oauthd.

sorbing avatar sorbing commented on August 24, 2024

When I use OAuth.redirect with AngularJS - I have broken routing after authorization and redirect to a page that accepts a parameters #oauthio={"status": "success", "data": ...}. And instead of the root route - /#!/, in the address bar is only a symbol #. In firebug i see error:

Error: [$location:ihshprfx] http://errors.angularjs.org/1.2.2/$location/ihshprfx...

My code:

OAuth.redirect(provider, {
  state: 'j5v1wdiQrZAz4Nuy1vg7WpmZCe2I3X10dE0rE4kZlA'
}, 'http://localhost/learning/oauthio/#!/');

from oauthd.

bumpmann avatar bumpmann commented on August 24, 2024

This should be fixed in a futur version, but currently i advise you to use either popup or an html5 routing in angular

from oauthd.

sorbing avatar sorbing commented on August 24, 2024

What will help me html5 routing?

from oauthd.

bumpmann avatar bumpmann commented on August 24, 2024

http://docs.angularjs.org/guide/dev_guide.services.$location in "html5 mode" you can get rid of hashbangs so i did not test yet but i guess it won't be a problem if the hash is removed

from oauthd.

bumpmann avatar bumpmann commented on August 24, 2024

It is now possible to use hashes in redirects. By example:

OAuth.initialize("...");

demoApp.controller('connectCtrl', function connectCtrl($scope, $rootScope, $location) {
    $scope.connect = function() {
        OAuth.redirect("twitter", "#/timeline");
    }
});

demoApp.controller('timelineCtrl', function timelineCtrl($scope, $rootScope) {
    OAuth.callback(function(err, res) {
        if (err) return alert(err);
        $rootScope.twitter = res;
    });

    $rootScope.twitter.get('/1.1/statuses/home_timeline.json').done(function(data) {
        $scope.tw_timeline = data;
        $scope.$apply();
    });
});

from oauthd.

jeffthompson1971 avatar jeffthompson1971 commented on August 24, 2024

I just moved to angular 1.3 today and of course, my oauth.io is broken. seems to redirect just fine adn my token is passed to me, but then the controller crashes and restarts.. so it's in some nasty loop. Any clue what i can do about this?

angular.min.js:100:132Error: [$rootScope:infdig] http://errors.angularjs.org/1.3.0-rc.5/$rootScope/infdig?p0=10&p1=%5B%5D
$digest@http://localhost/bower_components/angular/angular.min.js:120:330
$apply@http://localhost/bower_components/angular/angular.min.js:122:413
http://localhost/bower_components/angular/angular.min.js:18:107
e@http://localhost/bower_components/angular/angular.min.js:36:220
d@http://localhost/bower_components/angular/angular.min.js:18:28
pc@http://localhost/bower_components/angular/angular.min.js:18:317
Fd@http://localhost/bower_components/angular/angular.min.js:17:131
http://localhost/bower_components/angular/angular.min.js:244:464
j@http://localhost/bower_components/jquery/dist/jquery.min.js:2:27129
fireWith@http://localhost/bower_components/jquery/dist/jquery.min.js:2:54631
ready@http://localhost/bower_components/jquery/dist/jquery.min.js:2:29742
I@http://localhost/bower_components/jquery/dist/jquery.min.js:2:29927
angular.min.js:120Error: [$rootScope:infdig] http://errors.angularjs.org/1.3.0-rc.5/$rootScope/infdig?p0=10&p1=%5B%5D
angular.min.js:120:331Error: [$rootScope:infdig] http://errors.angularjs.org/1.3.0-rc.5/$rootScope/infdig?p0=10&p1=%5B%5D
angular.min.js:100:132null

from oauthd.

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.