简体   繁体   English

使用Djoser实现忘记密码的功能

[英]Implement forgot password functionality using Djoser

I am new to Django framework and now have a trouble with forgot password functionality. 我是Django框架的新手,但现在忘记密码功能遇到了麻烦。 I have read the documentation about that functionality but have some not clear. 我已经阅读了有关该功能的文档,但不清楚。 I need someone who can show me the steps on both frontend and backend in more detail. 我需要一个可以让我更详细地了解前端和后端步骤的人员。

reset() {
    var self = this;
    axios
        .post(this.$apiUrl + "password/reset/", {
            email: self.email
        })
        .then(response => {
            console.log(response);
        })
        .catch(error => {
            console.log(error);
        });
}

Please refer to documentation on this feature . 请参阅有关此功能的文档

Basically first you need to call the reset endpoint just as you did in question. 基本上,首先,您需要像有问题一样调用重置端点。 Next the user should receive an email which will point them to the url given in PASSWORD_RESET_CONFIRM_URL setting. 接下来,用户应该收到一封电子邮件,该电子邮件会将他们指向PASSWORD_RESET_CONFIRM_URL设置中给出的URL。 On that url your frontend app should call the confirmation url on API (see docs). 在该URL上,您的前端应用应在API上调用确认URL(请参阅文档)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM