The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/auth > reauthenticateWithPopup

reauthenticateWithPopup() function

Reauthenticates the current user with the specified OAuthProvider using a pop-up based OAuth flow.

Signature:

export declare function reauthenticateWithPopup(user: User, provider: AuthProvider, resolver?: PopupRedirectResolver): Promise<UserCredential>;

Parameters

Parameter Type Description
user User The user.
provider AuthProvider The provider to authenticate. The provider has to be an OAuthProvider. Non-OAuth providers like EmailAuthProvider will throw an error.
resolver PopupRedirectResolver An instance of PopupRedirectResolver, optional if already supplied to initializeAuth() or provided by getAuth().

Returns:

Promise<UserCredential>

Description

If the reauthentication is successful, the returned result will contain the user and the provider's credential.

Example

// Sign in using a popup.
const provider = new FacebookAuthProvider();
const result = await signInWithPopup(auth, provider);
// Reauthenticate using a popup.
await reauthenticateWithPopup(result.user, provider);