bigbluebutton-Github/labs/meteor-client/collections/users.js

26 lines
835 B
JavaScript
Raw Normal View History

Meteor.users = new Meteor.Collection('bbb_users');
this.Meetings = new Meteor.Collection('meetings');
2014-06-07 06:19:09 +08:00
Meteor.methods({
authenticate: function(auth) {
if (!auth.token)
throw new Meteor.Error(422, "You need a token to authenticate.");
if (!auth.userId)
throw new Meteor.Error(422, "You need a userId to authenticate.");
if (!auth.meetingId)
throw new Meteor.Error(422, "You need a meetingId to authenticate.");
var user = {userId: "user1", meetingId: "demo123"};
//UserSession.set(meetingId + ":" userId, user);
var userId = Meteor.users.insert(user);
2014-06-07 06:51:12 +08:00
console.log("User id=[" + userId + "]");
this.setUserId(userId);
console.log(this.userId);
return userId;
2014-06-07 06:19:09 +08:00
},
showUserId: function() {
throw new Meteor.Error(422, this.userId);
}
});