Git Product home page Git Product logo

backbone.basicauth's People

Contributors

achinaou avatar adamnengland avatar fiznool avatar idflood avatar lmjabreu avatar tjwebb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

backbone.basicauth's Issues

Registering it with Bower?

Thank you for this little extension. Just what I needed. I wonder though, is it possible to get this registered with Bower?

Backbone 1.1 support in bower.json

Currently only backbone 1.0.0 is supported in bower.json which makes it difficult for any project to upgrade to backbone 1.1 since bower would complain about dependency mismatch.

Original Sync is not preserved if it is overridden by calling app

If Backbone.sync is overridden by the calling app, when Backbone.BasicAuth.clear() is called, the overridden sync is not restored - instead, the version that ships with Backbone is restored.

Reproduction:

Backbone.BasicAuth.set('user', 'pass');

var originalSync = Backbone.sync;
Backbone.sync = function(method, model, options) {
  // Some extra stuff
  return originalSync.call(model, method, model, options);
}

// Next line sets Backbone.sync back to the version in backbone.js,
// not the one set above
Backbone.BasicAuth.clear();

Broken promise

One of the contracts of Backbone is that methods that call sync internally return the value of sync, because it is supposed to return a promise. I've noticed that on line 35 you just call the sync function, instead of returning it, and the result is that code that relies on a promise being returned does not get it.

Suggested alteration:

35: return originalSync.call(model, method, model, options);

Useful code though.

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.