Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { Injectable } from '@angular/core';
import * as firebase from 'firebase';
//...omitted
@Injectable()
export class AuthService {
resetPassword(email: string) {
var auth = firebase.auth();
return auth.sendPasswordResetEmail(email)
.then(() => console.log("email sent"))
.catch((error) => console.log(error))
}
}
<button (click)="resetPassword('hello@angularfirebase.com')">Reset Password</button>
import { Component } from '@angular/core';
import { AuthService } from "./somewhere/auth.service";
@Component({
// omitted...
})
export class ResetPasswordComponent {
resetPassword(email: string) {
this.auth.resetPassword(email)
}
}
@Satish-Lakhani

This comment has been minimized.

Copy link

@Satish-Lakhani Satish-Lakhani commented Feb 6, 2018

Hi, how can i redirect user back to webpage after password has been reset?

Thanks

@yashgandhi303

This comment has been minimized.

Copy link

@yashgandhi303 yashgandhi303 commented Apr 19, 2018

just give a router link to a webpage or login page.

@scotsalazar

This comment has been minimized.

Copy link

@scotsalazar scotsalazar commented Jul 17, 2018

@yashgandhi303 can you give me an example code pls? thank you

@Seanmclem

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment