Check Password in ContentType Controller

纵饮孤独 提交于 2021-01-29 09:23:54

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!