Skip to content

Commit

Permalink
feat: additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong committed Sep 19, 2024
1 parent ad2d8ed commit 54f025b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import {BrowserRouter} from 'react-router-dom';
const load = async () => {
unregister();
await Auth.initialize();
// The following handles the OIDC post-authentication flow.
// 1. User clicks Sign In button
// 2. OidcBroker instantiates a popup,
// 3. User completes the auth dance and is redirected to this path
// 4. Application (this component) detects that path and instructs the OidcBroker to close the popup
// 5. After popup close, user is directed to the original url. This works for the cases we support:
// 5a. Logging in from the home page
// 5b. Logging in from a link, i.e. `<origin>/dataLibrary`
// 5c. Logging in from a link with a `redirectTo` query param, i.e. `<origin>?redirectTo=/dataLibrary`
if (window.location.pathname.startsWith('/redirect-from-oauth')) {
await OidcBroker.getUserManager().signinPopupCallback(window.location.href);
}
Expand Down

0 comments on commit 54f025b

Please sign in to comment.