【问题标题】:How Reset Password using angular 7 with webAPI如何使用 Angular 7 和 webAPI 重置密码
【发布时间】:2019-08-09 20:27:36
【问题描述】:

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

这是怎么做到的?

【问题讨论】:

    标签: asp.net-web-api passwords reset


    【解决方案1】:

    您可以从 ASP.NET Identity 下载用于密码恢复/重置的示例。

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

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

    之后,您在 Angular 中创建一个服务来调用带有电子邮件输入的 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
      });
      }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-01
      • 2017-12-24
      • 2023-03-25
      相关资源
      最近更新 更多