GithubHelp home page GithubHelp logo

db.users.drop() causes trouble about derby-auth HOT 3 OPEN

ile avatar ile commented on May 27, 2024
db.users.drop() causes trouble

from derby-auth.

Comments (3)

lefnire avatar lefnire commented on May 27, 2024

Hit me up with a PR if you can think of a work around, or any suggestions
on handling configurable collection name?

On Mon, Feb 18, 2013 at 6:30 PM, Ilkka Huotari [email protected]:

db.users.drop() seems to cause problems - the code (derby-auth) assumes
that everything is ok when the sess.userId is set, but actually the
database can be empty, which isn't noticed that that point (
https://github.com/lefnire/derby-auth/blob/master/index.js#L64), and it
will lead to problems afterwards.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20.

from derby-auth.

ile avatar ile commented on May 27, 2024

Not sure, but should it just do a model.fetch around that point (line 64)? Of course an extra model.fetch feels bad though...

In the app code there will probably be this: model.set '_user', user

... would it be wise to do that at the derby-auth level already?

Just some ideas, I really don't know what's best here..

from derby-auth.

ile avatar ile commented on May 27, 2024

Here's one way to do it (maybe): ile@5207118

(A bit too much code got in. I'm also making hooks for users_public collection because I think that's what I need... By querying users_public I get a hash array and not a normal array like with motifs .... so maybe a PR isn't a good idea with this commit)

You can decide what to do with this, copy & paste or improve or anything.

from derby-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.