-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Throw when initialize has not been called #6233
Conversation
Codecov Report
|
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.
Looks good besides one minor comment, thanks for this!
…ft-authentication-library-for-js into throw-without-initialize
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.
Can we not initialize ourselves by default instead of adding this check at a zillion places?
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.
Can we sync up once before I approve this on why we chose not to initialize ourselves or if there is a better way to do this?
There's not much we can do since initialize is async. We need these checks because someone could instantiate a PCA and start calling APIs without initializing. |
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.
As discussed, approving with suggestions to improve on this for the next major version. Also:
nit: Can we rename the function name to blockAPICallsBeforeInitialize()
?
…ft-authentication-library-for-js into throw-without-initialize
…ble-e2e-test spec files
…ft-authentication-library-for-js into throw-without-initialize
…ication in react samples
…iation + initialize
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.
lgtm
This PR:
BrowserUtils.blockNativeBrokerCalledBeforeInitialize
withBrowserUtils.blockCallsBeforeInitialize
since nowinitialize
call is required regardless of whetherallowNativeBroker
is enabledBrowserUtils.blockCallsBeforeInitialize
in all public APIs related to token acquisition and accountsBrowserAuthError.createNativeBrokerCalledBeforeInitialize()
withBrowserAuthError.createUninitializedPublicClientApplication()
and updates error message