Is there a server-side session in meteor

I have a meteor site in which the login process is done via github. Github has a a very easy API and I can easily do this. However, when this authentication process is done, I have no idea how to validate requests made by the client. I think I need to use the collection's allow and deny methods, but how do I know which user made the request. I haven't seen any cookie information. Any help would be appreciated ?

Answers


allow and deny pass the userId along with the object trying to be updated...

We do it like this:

Fundraiser.allow({
  insert: function (userId, fundraiser) {
    return userId;
  },

  update: function (userId, fundraiser, fields) {
    return fundraiser.userId === userId;
  },

  remove: function (userId, fundraiser) {
    return fundraiser.userId === userId;
  }
});

Kind of, and its default expiration time is 90 days:

console.log("sessions:", Meteor.user().services.resume.loginTokens)

Unfortunately services.resume.loginTokens is not valid for storage according to Mongo, so use UserSession.


Need Your Help

Google map in Angular JS: Event listener in a marker doesn't redirect

javascript angularjs google-maps google-maps-api-3

I'm having a small problem when trying to attach an event listener to a Google Maps Marker that redirects to a different route using angular.

Can I write this regex in one step?

c# .net regex replace

This is the input string "23x +y-34 x + y+21x - 3y2-3x-y+2". I want to surround every '+' and '-' character with whitespaces but only if they are not allready sourrounded from left or right side. S...