Fix joinDefaultChannels for Custom OAuth

Closes #5376
pull/5651/head
Rodrigo Nascimento 9 years ago
parent 05d9f68940
commit 68bf34f722
No known key found for this signature in database
GPG Key ID: 2C85B3AFE75D23F9
  1. 4
      server/lib/accounts.coffee

@ -81,6 +81,10 @@ Accounts.insertUserDoc = _.wrap Accounts.insertUserDoc, (insertUserDoc, options,
_id = insertUserDoc.call(Accounts, options, user)
# Get user from db again to get all fields added by middlewares like
# validateNewUser and others.
user = Meteor.users.findOne({_id: _id});
# Add user to default channels
if user.username? and options.joinDefaultChannels isnt false and user.joinDefaultChannels isnt false
Meteor.runAsUser _id, ->

Loading…
Cancel
Save