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

27 lines
783 B
JavaScript
Raw Normal View History

2014-06-07 06:19:09 +08:00
Users = new Meteor.Collection('bbb_users');
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);
2014-06-07 06:19:09 +08:00
return userId;
},
showUserId: function() {
throw new Meteor.Error(422, this.userId);
}
2014-06-07 06:51:12 +08:00
});