Giter Site home page Giter Site logo

Compatiblity about meteor-event-horizon HOT 5 OPEN

belisarius222 avatar belisarius222 commented on July 18, 2024
Compatiblity

from meteor-event-horizon.

Comments (5)

belisarius222 avatar belisarius222 commented on July 18, 2024

Thanks, glad to hear it's useful!

I don't think this package will work on the server, since Deps is only
defined client-side.

What I'd recommend to get the server to do something when a user logs in
would be to have the client call a server-side method like so:

// client
EventHorizon.on('loggedIn',function(){ Meteor.call('onLogin'); });

// server
Meteor.methods({
  onLogin: function() {
    console.log('user logged in: '+this.userId);
  }
});

Would that work?

On Thu, Mar 21, 2013 at 12:46 AM, Tarangp [email protected] wrote:

Wonderful package @belisarius222 https://github.com/belisarius222!! I
particularly find good use with the loggedIn event. I had to previously
write an adequately long check.

Is it possible to have this loggedIn/loggedOut event on the server?


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

from meteor-event-horizon.

Tarang avatar Tarang commented on July 18, 2024

I'm using that at the moment, the trouble is the logout method. I can't use accounts-ui without modifying it because I have to employ a callback from Meteor.call to logout on the client. If I Meteor.call after logging out meteor won't be able to tell which user it was

from meteor-event-horizon.

belisarius222 avatar belisarius222 commented on July 18, 2024

Hmm, you could maybe store the userId in a variable while logged in, like
Meteor.previousUserId or something, and then when you get a loggedOut event
on the client, run Meteor.call('onLogout',Meteor.previousUserId);

Not sure about the security implications of that approach.

On Thu, Mar 21, 2013 at 9:52 PM, Tarangp [email protected] wrote:

I'm using that at the moment, the trouble is the logout method. I can't
use accounts-ui without modifying it because I have to employ a callback
from Meteor.call to logout on the client. If I Meteor.call after logging
out meteor won't be able to tell which user it was


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-15281198
.

from meteor-event-horizon.

 avatar commented on July 18, 2024

Ah I see now. That is how I am making the call to the server. I wonder if it's possible to make EventHorizon work on server side as well?

It would be nice to have some sort of interface between the two that is hidden to the developer's eyes. But I guess this is not necessary as Meteor.call() is essentially same. The beauty of this would be you wouldn't have to have to expose all the Meteor.methods.

client.js
EventHorizon.fire{'loggedin'}

server/events.js
EventHorizon.on{'loggedIn', handleUser};

from meteor-event-horizon.

Tarang avatar Tarang commented on July 18, 2024

@belisarius222 this is tricky because I would be able to trick the onLogOut method on the server with a random userId & not be able to verify its legitimate so it poses a bit of a security risk. I have meteor connecting to facebook's xmpp servers & I want to be able to tell them to log out, for now I'm using a callback & waiting to disconnect first.

from meteor-event-horizon.

Related Issues (4)

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.