如何使用带有Web API的angular 7重置密码

问题描述 投票:0回答:1

我想生成重置密码链接以发送到用户的电子邮件,该电子邮件将打开ResetPassword页面。在此页面上,我将填写有关新密码的详细信息,然后确认密码。

怎么做到这一点?

asp.net-web-api passwords reset
1个回答
0
投票

您可以从ASP.NET Identity下载样本以进行密码恢复/重置。

使用电子邮件输入编写API并根据示例发送到电子邮件重置链接。

https://docs.microsoft.com/en-us/aspnet/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity

之后,您创建一个角度服务,通过电子邮件输入调用web api。

@Injectable()
export class UserService {
constructor(private http: HttpClient) {
}
resetpassword(email: string){
    return this.http.get('/api/user/resetpassword?email=' + email)
      .map(response => {
        // handle logic here
  });
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.