Angularfire: Feature request: Send verification email

Created on 15 Apr 2017  路  2Comments  路  Source: angular/angularfire

feature request & proposal:

What is the expected behavior?

when create new account with AngularFire.auth.createUser a verification email will be sent.

What is the current behavior?

when create new account with
AngularFire.auth.createUser({
email: userEmail,
password: userPasswd
})
emailVerified property is set to false

Most helpful comment

thanks @markgoho
your idea is great, I used it as described below:

import { AngularFire, AuthProviders,AuthMethods} from 'angularfire2';
import * as firebase from 'firebase';

(......)

      this.af.auth.createUser({
        email: this.emailAddress,
        password: this.passWord
      }).then(
        (success) => {
           let user:any = firebase.auth().currentUser;
           user.sendEmailVerification().then(
             (success) => {console.log("please verify your email")} 
           ).catch(
             (err) => {
               this.error = err;
             }
           )

        }).catch(
          (err) => {
            this.error = err;
          })

it works fine now :)

All 2 comments

Hi @da45 this is something you can do with the Firebase SDK right now: https://firebase.google.com/docs/auth/web/manage-users#send_a_user_a_verification_email

I know @davideast and others are working on a big revamp of the Auth system for AngularFire2, so I'm not sure if this is something they can include, but you can add Firebase in and do it right now if you're up for it!

thanks @markgoho
your idea is great, I used it as described below:

import { AngularFire, AuthProviders,AuthMethods} from 'angularfire2';
import * as firebase from 'firebase';

(......)

      this.af.auth.createUser({
        email: this.emailAddress,
        password: this.passWord
      }).then(
        (success) => {
           let user:any = firebase.auth().currentUser;
           user.sendEmailVerification().then(
             (success) => {console.log("please verify your email")} 
           ).catch(
             (err) => {
               this.error = err;
             }
           )

        }).catch(
          (err) => {
            this.error = err;
          })

it works fine now :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Leanvitale picture Leanvitale  路  3Comments

jteplitz picture jteplitz  路  3Comments

goekaypamuk picture goekaypamuk  路  3Comments

adriandurran picture adriandurran  路  3Comments

jnupeter picture jnupeter  路  3Comments