fix: self-registration not assigning to predefined group

This commit is contained in:
Nick 2019-06-08 13:30:07 -04:00
parent 40d224e8c0
commit f93ea02975

View File

@ -425,6 +425,11 @@ module.exports = class User extends Model {
isVerified: false isVerified: false
}) })
// Assign to group(s)
if (_.get(localStrg, 'autoEnrollGroups.v', []).length > 0) {
await newUsr.$relatedQuery('groups').relate(localStrg.autoEnrollGroups.v)
}
if (verify) { if (verify) {
// Create verification token // Create verification token
const verificationToken = await WIKI.models.userKeys.generateToken({ const verificationToken = await WIKI.models.userKeys.generateToken({