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

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -