Skip to content

Commit

Permalink
Reference the signInWithRedirect best practices in docs (#6927)
Browse files Browse the repository at this point in the history
Fix a typo in the reauthenticateWithRedirect example.
  • Loading branch information
prameshj authored Jan 6, 2023
1 parent 1455bfa commit cd92522
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/auth/src/platform_browser/strategies/redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { getModularInstance } from '@firebase/util';
*
* @remarks
* To handle the results and errors for this operation, refer to {@link getRedirectResult}.
* Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link signInWithRedirect}.
*
* @example
* ```javascript
Expand Down Expand Up @@ -103,6 +104,9 @@ export async function _signInWithRedirect(

/**
* Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.
* @remarks
* To handle the results and errors for this operation, refer to {@link getRedirectResult}.
* Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link reauthenticateWithRedirect}.
*
* @example
* ```javascript
Expand All @@ -113,8 +117,8 @@ export async function _signInWithRedirect(
*
* // 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);
* // Reauthenticate using a redirect.
* await reauthenticateWithRedirect(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
Expand Down Expand Up @@ -162,6 +166,9 @@ export async function _reauthenticateWithRedirect(

/**
* Links the {@link OAuthProvider} to the user account using a full-page redirect flow.
* @remarks
* To handle the results and errors for this operation, refer to {@link getRedirectResult}.
* Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link linkWithRedirect}.
*
* @example
* ```javascript
Expand Down

0 comments on commit cd92522

Please sign in to comment.