Saturday 15 May 2010

javascript - How to reset and post custom data to Stormpath -



javascript - How to reset and post custom data to Stormpath -

i json info client , want save stormpaths custom info using node.js express.js:

i've got basic post route:

app.post('/post', stormpath.loginrequired, function(req, res){ var info = req.body; res.locals.user.customdata.test = data; res.locals.user.customdata.save();

});

i want overwrite given info in customdata.test , save it, right it's adding given info customdata.test.

how prepare that?

it sounds want set info properties straight onto custom info object? i'd suggest using "extend" function re-create data properties onto customdata object.

for illustration using underscore extend:

_.extend(req.locals.user.customdata, data);

i xtend

javascript node.js express stormpath

No comments:

Post a Comment