问题
I want a user to enter his password again if he wants to edit some important data, i. e. after he is already logged in. How can I check his password in the Controller of a ContentType?
Thanks a lot!
P.S. I would like a method like checkPassword(pwd){...}
:
var queryEdit.description = ctx.request.body.description;
var pwd = ctx.request.body.password;
delete ctx.request.body.password;
if (checkPassword(pwd) === true) {
let obj = await strapi.services.key.edit(ctx.params, queryEdit);
}
来源:https://stackoverflow.com/questions/60127410/check-password-in-contenttype-controller