Back to Firebase Js Sdk

ConfirmationResult interface

docs-devsite/auth.confirmationresult.md

12.12.11.9 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

ConfirmationResult interface

A result from a phone number sign-in, link, or reauthenticate call.

<b>Signature:</b>

typescript
export interface ConfirmationResult 

Properties

PropertyTypeDescription
verificationIdstringThe phone number authentication operation's verification ID.

Methods

MethodDescription
confirm(verificationCode)Finishes a phone number sign-in, link, or reauthentication.

ConfirmationResult.verificationId

The phone number authentication operation's verification ID.

This can be used along with the verification code to initialize a PhoneAuthCredential<!-- -->.

<b>Signature:</b>

typescript
readonly verificationId: string;

ConfirmationResult.confirm()

Finishes a phone number sign-in, link, or reauthentication.

<b>Signature:</b>

typescript
confirm(verificationCode: string): Promise<UserCredential>;

Parameters

ParameterTypeDescription
verificationCodestringThe code that was sent to the user's mobile device.

<b>Returns:</b>

Promise<UserCredential<!-- -->>

Example

javascript
const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);
// Obtain verificationCode from the user.
const userCredential = await confirmationResult.confirm(verificationCode);