Skip to content

Commit 78b1a48

Browse files
committed
Create verifyEmail, resetPassword
and updatePassword API
1 parent 8a87854 commit 78b1a48

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.env.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ REACT_APP_PROJECT_ID=YOUR_PROJECT_ID
55
REACT_APP_STORAGE_BUCKET=YOUR_STORAGE_BUCKET
66
REACT_APP_MESSAGING_SENDER_ID=YOUR_MESSAGING_SENDER_ID
77
REACT_APP_APP_ID=YOUR_APP_ID
8+
9+
REACT_APP_EMAIL_CONFIRMATION_REDIRECT=http://localhost:3000

src/services/firebase/firebase.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ class Firebase {
2020

2121
signOut = () => this.auth.signOut();
2222

23+
verifyEmail = () =>
24+
this.auth.currentUser.sendEmailVerification({
25+
url: process.env.REACT_APP_EMAIL_CONFIRMATION_REDIRECT
26+
});
27+
28+
resetPassword = email => this.auth.sendPasswordResetEmail(email);
29+
30+
updatePassword = password => this.auth.currentUser.updatePassword(password);
31+
2332
addUser = (uid, userData) =>
2433
this.db
2534
.collection('users')

0 commit comments

Comments
 (0)