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

Adjust InjectionToken<T> constants in msal-angular to support typed Angular 14+ inject() #7484

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Adjust InjectionToken<T> usage so that properly-typed tokens can be used with new `inject(TOKEN)` syntax.",
"packageName": "@azure/msal-angular",
"email": "[email protected]",
"dependentChangeType": "patch"
}
20 changes: 12 additions & 8 deletions lib/msal-angular/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
*/

import { InjectionToken } from "@angular/core";
import { type IPublicClientApplication } from "@azure/msal-browser";
import { type MsalBroadcastConfiguration } from "./msal.broadcast.config";
import { type MsalGuardConfiguration } from "./msal.guard.config";
import { type MsalInterceptorConfiguration } from "./msal.interceptor.config";

export const MSAL_INSTANCE = new InjectionToken<string>("MSAL_INSTANCE");
export const MSAL_INSTANCE = new InjectionToken<IPublicClientApplication>(
"MSAL_INSTANCE"
);

export const MSAL_GUARD_CONFIG = new InjectionToken<string>(
export const MSAL_GUARD_CONFIG = new InjectionToken<MsalGuardConfiguration>(
"MSAL_GUARD_CONFIG"
);

export const MSAL_INTERCEPTOR_CONFIG = new InjectionToken<string>(
"MSAL_INTERCEPTOR_CONFIG"
);
export const MSAL_INTERCEPTOR_CONFIG =
new InjectionToken<MsalInterceptorConfiguration>("MSAL_INTERCEPTOR_CONFIG");

export const MSAL_BROADCAST_CONFIG = new InjectionToken<string>(
"MSAL_BROADCAST_CONFIG"
);
export const MSAL_BROADCAST_CONFIG =
new InjectionToken<MsalBroadcastConfiguration>("MSAL_BROADCAST_CONFIG");
Loading