customData.id
用户注册到我的应用程序后,会在本地 MySQL 服务器中分配一个 ID,然后在相应的 Stormpath 帐户中注册相同的 ID 。
这在迁移到 Okta 之前有效(使用 express-stormpath 版本 3.2.0)。迁移和更新到 4.0.0 版后,相同的代码不再起作用,我找不到参考或文档来了解要更改的内容。没有显式错误,但 customData 不会出现在“配置文件”下的新帐户中,并且如果调用结果未定义。
相关postRegistrationHandler
:
postRegistrationHandler: function(account, req, res, next) {
account.getCustomData(function(err, data) {
if (err) {
return next(err);
}
else {
var newaccount = {
email: account.email,
isgestore: isgestore,
stormpath_href: account.href,
dataiscrizione: new Date()
};
db.query('SELECT * FROM utenti WHERE email = "'+account.email+'";', function(err,check){
if(err) throw err;
if(check==''){
res.sendStatus(500);
} else {
db.query('UPDATE utenti SET ? WHERE email = "'+account.email+'";', newaccount, function(err,result){
if(err) throw err;
data.id = check[0].id;
data.save();
res.redirect('/regRedirect');
});
}
});
}
});
},
从 Stormpath 迁移到 Okta 是成功的,并且 customData 已正确导入。该问题仅出现在新注册的帐户中。