-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Standalone functions in PCA #7810
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
base: msal-v5
Are you sure you want to change the base?
Conversation
*/ | ||
export function initializeServerTelemetryManager( | ||
apiId: number, | ||
config: BrowserConfiguration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the whole config here or can we just pass in the clientId?
// Clear all accounts and tokens | ||
await browserStorage.clear(correlationId); | ||
// Clear any stray keys from IndexedDB | ||
await browserCrypto.clearKeystore(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like something that should be handled by the clear function above. Thoughts?
* @param popupWindow - window that is being monitored | ||
* @param timeout - timeout for processing hash once popup is redirected back to application | ||
*/ | ||
export async function monitorPopupForHash( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: IMO it's preferable to keep all the popup code together in the same file
export async function monitorPopupForHash( | ||
popupWindow: Window, | ||
popupWindowParent: Window, | ||
config: BrowserConfiguration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to pass in the whole config object or can this accept the timeout & responseMode directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just pass the whole config object around? Is there a penalty for doing so? Minification impact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions but nothing blocking
Turns the following into standalone exported functions to help minify them on build output:
BaseInteractionClient
:getRedirectUri()
getDiscoveredAuthority
initializeServerTelemetryManager()
StandardInteractionClient
:InitializeAuthorizationRequest()
PopupClient
:monitorPopupForHash()
cleanPopup()