Meteor User Accounts - OnSignin -
i've changed schema include sub-schemas. want group relevant data , make easier manage. unfortanly has broken registration process. how make autoform insert firstname sub-schema. thoughts?
path: at_config.js
accountstemplates.addfields([ { _id: "details.firstname", type: 'text', displayname: "first name", required: true, minlength: 1, maxlength: 37 } ]); path: schema.js
accountstemplates.configure({ schema.userdetails = new simpleschema({ firstname: { type: string, optional: false } }); schema.userprofile = new simpleschema({ details: { type: schema.userdetails, optional: true }, }); schema.user = new simpleschema({ profile: { type: schema.userprofile, optional: true } }); meteor.users.attachschema(schema.user); path: startup.js
accounts.oncreateuser(function (options, user) { if (options.profile && options.profile.roles) { //include user profile roles.setrolesonuserobj(user, options.profile.roles); } if (options.profile) { // include user profile user.profile = options.profile; } return user; });
Comments
Post a Comment