Skip to content

Commit 212d1ba

Browse files
authored
Fix addEventCallback input parameter type (#6353)
Fixes input parameter type for addEventCallback which broke when moving from v2 to v3 Addresses #6309
1 parent a34066e commit 212d1ba

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Fix input parameter type for addEventCallback",
4+
"packageName": "@azure/msal-browser",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

lib/msal-browser/src/app/IPublicClientApplication.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { ITokenCache } from "../cache/ITokenCache";
2121
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
2222
import { BrowserConfiguration } from "../config/Configuration";
2323
import { AuthenticationResult } from "../response/AuthenticationResult";
24+
import { EventCallbackFunction } from "../event/EventMessage";
2425

2526
export interface IPublicClientApplication {
2627
initialize(): Promise<void>;
@@ -32,7 +33,7 @@ export interface IPublicClientApplication {
3233
acquireTokenByCode(
3334
request: AuthorizationCodeRequest
3435
): Promise<AuthenticationResult>;
35-
addEventCallback(callback: Function): string | null;
36+
addEventCallback(callback: EventCallbackFunction): string | null;
3637
removeEventCallback(callbackId: string): void;
3738
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
3839
removePerformanceCallback(callbackId: string): boolean;

lib/msal-browser/src/app/PublicClientApplication.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { StandardController } from "../controllers/StandardController";
2424
import { BrowserConfiguration, Configuration } from "../config/Configuration";
2525
import { StandardOperatingContext } from "../operatingcontext/StandardOperatingContext";
2626
import { AuthenticationResult } from "../response/AuthenticationResult";
27+
import { EventCallbackFunction } from "../event/EventMessage";
2728

2829
/**
2930
* The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications
@@ -140,7 +141,7 @@ export class PublicClientApplication implements IPublicClientApplication {
140141
* Adds event callbacks to array
141142
* @param callback
142143
*/
143-
addEventCallback(callback: Function): string | null {
144+
addEventCallback(callback: EventCallbackFunction): string | null {
144145
return this.controller.addEventCallback(callback);
145146
}
146147

lib/msal-browser/src/controllers/IController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { EventHandler } from "../event/EventHandler";
2828
import { PopupClient } from "../interaction_client/PopupClient";
2929
import { SilentIframeClient } from "../interaction_client/SilentIframeClient";
3030
import { AuthenticationResult } from "../response/AuthenticationResult";
31+
import { EventCallbackFunction } from "../event/EventMessage";
3132

3233
export interface IController {
3334
initialize(): Promise<void>;
@@ -55,7 +56,7 @@ export interface IController {
5556
silentRequest: SilentRequest
5657
): Promise<AuthenticationResult>;
5758

58-
addEventCallback(callback: Function): string | null;
59+
addEventCallback(callback: EventCallbackFunction): string | null;
5960

6061
removeEventCallback(callbackId: string): void;
6162

0 commit comments

Comments
 (0)