voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
47 lines (30 loc) • 1.94 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/auth](./auth.md) > [reauthenticateWithRedirect](./auth.reauthenticatewithredirect.md)
## reauthenticateWithRedirect() function
Reauthenticates the current user with the specified [OAuthProvider](./auth.oauthprovider.md) using a full-page redirect flow.
<b>Signature:</b>
```typescript
export declare function reauthenticateWithRedirect(user: User, provider: AuthProvider, resolver?: PopupRedirectResolver): Promise<never>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| user | [User](./auth.user.md) | The user. |
| provider | [AuthProvider](./auth.authprovider.md) | The provider to authenticate. The provider has to be an [OAuthProvider](./auth.oauthprovider.md)<!-- -->. Non-OAuth providers like [EmailAuthProvider](./auth.emailauthprovider.md) will throw an error. |
| resolver | [PopupRedirectResolver](./auth.popupredirectresolver.md) | An instance of [PopupRedirectResolver](./auth.popupredirectresolver.md)<!-- -->, optional if already supplied to [initializeAuth()](./auth.initializeauth.md) or provided by [getAuth()](./auth.getauth.md)<!-- -->. |
<b>Returns:</b>
Promise<never>
## Example
```javascript
// Sign in using a redirect.
const provider = new FacebookAuthProvider();
const result = await signInWithRedirect(auth, provider);
// This will trigger a full page redirect away from your app
// After returning from the redirect when your app initializes you can obtain the result
const result = await getRedirectResult(auth);
// Link using a redirect.
await linkWithRedirect(result.user, provider);
// This will again trigger a full page redirect away from your app
// After returning from the redirect when your app initializes you can obtain the result
const result = await getRedirectResult(auth);
```