Skip to content

Commit f9be571

Browse files
authored
Merge pull request #2 from jszwedko/add-password-reset
Add Auth.SendPasswordResetEmail
2 parents 16beb6b + 5bf9c94 commit f9be571

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

auth.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,17 @@ func (auth *Auth) UpdateUser(user *User) (*UserRecord, error) {
338338
}
339339
return res, nil
340340
}
341+
342+
// SendPasswordResetEmail sends password reset for the given user
343+
// Only useful for the Email/Password provider
344+
func (auth *Auth) SendPasswordResetEmail(email string) error {
345+
r := auth.client.Relyingparty.GetOobConfirmationCode(&identitytoolkit.Relyingparty{
346+
Email: email,
347+
RequestType: "PASSWORD_RESET",
348+
})
349+
_, err := r.Do()
350+
if err != nil {
351+
return err
352+
}
353+
return nil
354+
}

0 commit comments

Comments
 (0)