2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

React Native Firebase でユーザのEmailを認証する

Posted at

コード

RNFirebase.User内にEmailの認証を行うメールを送信する sendEmailVerification( ) が用意されている。

user.ts
import firebase, { RNFirebase } from 'react-native-firebase'

class User {
  private user: RNFirebase.User

  constructor() {
    firebase.auth().onAuthStateChanged((user: RNFirebase.User) => {
      this.user = user
    })
  }

  verifyEmail = () => {
    this.user.sendEmailVerification()
  }
}

注意点

メール内のリンクからEmail認証後に、サインインしなおすか、RNFirebase.User内の**reauthenticateWithCredential(credential)**を実行しないと認証されていないことになってしまう。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?