Skip to content

Conversation

@bradkovach
Copy link

(desc copied from #7484)

This PR adjusts InjectionToken instantiation to use the proper template type parameter (instead of string), so that the new Angular 14+ inject(TOKEN) syntax can be used if desired.

import { MSAL_INSTANCE, MSAL_GUARD_CONFIG, MSAL_INTERCEPTOR_CONFIG, MSAL_BROADCAST_CONFIG
@Component({
   // ...
})
export class MyComponent {
   msalInstance = inject(MSAL_INSTANCE); // resolves to IPublicClientApplication
   msalGuardConfig = inject(MSAL_GUARD_CONFIG); // resolves to MsalGuardConfiguration
   msalInterceptorConfig = inject(MSAL_INTERCEPTOR_CONFIG); // resolves to MsalInterceptorConfiguration
   msalBroadcastConfig = inject(MSAL_BROADCAST_CONFIG); // resolves to MsalBroadcastConfiguration
}

@bradkovach
Copy link
Author

@shylasummers this branch resolves all of the issues from the other PR

@shylasummers
Copy link
Contributor

Hi @bradkovach, looks like you still need to adjust the changefile. This is a major (breaking) change. Try deleting this changefile and re-running while selecting major as the type.

@shylasummers
Copy link
Contributor

@bradkovach bumping the request for a changefile fix

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Apr 14, 2025
@shylasummers
Copy link
Contributor

@bradkovach bumping one more time for the changefile fix

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Apr 22, 2025
@bradkovach
Copy link
Author

@shylasummers new beachballs are available for you

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels Apr 24, 2025
@shylasummers
Copy link
Contributor

@bradkovach Please change the changefile type to major. You also only should have one changefile.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Apr 24, 2025
@bradkovach
Copy link
Author

I sent this in as a breaking change even though it doesn't break anything because old, improper types had to be manually over-ridden, so those type casts will still be in place when folks upgrade.

Since you're targeting this for v5, I don't think that matters.

However, since there were concerns, I authored a unit test that uses @ts-expect-error to ensure that the inferred types are strong, and resistant to mistyping.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels Apr 24, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Apr 24, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 12, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Jun 10, 2025
tnorling added a commit that referenced this pull request Jul 2, 2025
… with msal-angular (#7653) (#7745)

PR to run #7653 by @bradkovach against CI.

---------

Co-authored-by: Brad Kovach <[email protected]>
Co-authored-by: Thomas Norling <[email protected]>
Co-authored-by: Eugene <[email protected]>
@tnorling
Copy link
Collaborator

tnorling commented Jul 2, 2025

Closing as this was merged via #7745, thanks for the contribution!

@tnorling tnorling closed this Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

msal-angular Related to @azure/msal-angular package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants