I am the author of the library express-stormpath, I would do this:
Stormpath , , customData :
app.use(stormpath.init(app, {
...,
expandCustomData: true,
}));
, :
app.post('/post', stormpath.loginRequired, function(req, res, next) {
var studentPlan = req.body;
console.log(studentPlan);
req.user.customData.studentPlan = studentPlan;
req.user.customData.save(function(err) {
if (err) {
next(err);
} else {
res.send('success!');
}
});
});
, , , customData. Stormpath "" customData, , , .
, =)