Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handleRedirectPromise docs to login-user and acquire-token docs #6930

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

hectormmg
Copy link
Member

This PR:

  • Adds handleRedirectPromise section to docs that explain redirect API usage

@github-actions github-actions bot added documentation Related to documentation. msal-browser Related to msal-browser package labels Feb 29, 2024
@hectormmg hectormmg enabled auto-merge (squash) February 29, 2024 20:23

Note: If you are using `msal-angular` or `msal-react`, redirects are handled differently, and you should see the [`msal-angular` redirect doc](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/redirects.md) and [`msal-react` FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-react/FAQ.md#how-do-i-handle-the-redirect-flow-in-a-react-app) for more details.

The redirect APIs are asynchronous (i.e. return a promise) `void` functions which redirect the browser window after caching some basic info. If you choose to use the redirect APIs, be aware that **you MUST call `handleRedirectPromise()` to correctly handle the API**. You can use the following function to perform an action when this token exchange is completed:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this clear that you need to call this automatically on every page load. It might even help to combine this code snippet with the one above to illustrate that this comes first.

Copy link
Contributor

Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-browser Related to msal-browser package Needs: Attention 👋 Awaiting response from the MSAL.js team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants