Skip to content

Commit

Permalink
Merge branch 'dev' into node-broker-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnorling committed Apr 20, 2023
2 parents 72f3d1c + 4f26fba commit 39c4d55
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "`removeAccount` does not throw if account does not exist in cache #5911",
"packageName": "@azure/msal-common",
"email": "thomas.norling@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Remove `null` from `acquireTokenSilent` return type #5912",
"packageName": "@azure/msal-node",
"email": "thomas.norling@microsoft.com",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion lib/msal-common/src/cache/CacheManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ export abstract class CacheManager implements ICacheManager {
async removeAccount(accountKey: string): Promise<void> {
const account = this.getAccount(accountKey);
if (!account) {
throw ClientAuthError.createNoAccountFoundError();
return;
}
await this.removeAccountContext(account);
this.removeItem(accountKey);
Expand Down
8 changes: 4 additions & 4 deletions lib/msal-common/test/client/AuthorizationCodeClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3112,7 +3112,7 @@ describe("AuthorizationCodeClient unit tests", () => {
);
});

it.skip("includes the requestId in the result when received in server response", async () => {
it("includes the requestId in the result when received in server response", async () => {
sinon
.stub(
Authority.prototype,
Expand Down Expand Up @@ -3179,7 +3179,7 @@ describe("AuthorizationCodeClient unit tests", () => {
);
});

it.skip("does not include the requestId in the result when none in server response", async () => {
it("does not include the requestId in the result when none in server response", async () => {
sinon
.stub(
Authority.prototype,
Expand Down Expand Up @@ -3243,7 +3243,7 @@ describe("AuthorizationCodeClient unit tests", () => {
expect(authenticationResult.requestId).toEqual("");
});

it.skip("includes the http version in Authorization code client measurement(AT) when received in server response", async () => {
it("includes the http version in Authorization code client measurement(AT) when received in server response", async () => {
sinon
.stub(
Authority.prototype,
Expand Down Expand Up @@ -3320,7 +3320,7 @@ describe("AuthorizationCodeClient unit tests", () => {
});
});

it.skip("does not add http version to the measurement when not received in server response", async () => {
it("does not add http version to the measurement when not received in server response", async () => {
sinon
.stub(
Authority.prototype,
Expand Down
2 changes: 1 addition & 1 deletion lib/msal-node/src/client/ClientApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export abstract class ClientApplication {
*/
async acquireTokenSilent(
request: SilentFlowRequest
): Promise<AuthenticationResult | null> {
): Promise<AuthenticationResult> {
const validRequest: CommonSilentFlowRequest = {
...request,
...(await this.initializeBaseRequest(request)),
Expand Down
2 changes: 1 addition & 1 deletion lib/msal-node/src/client/IPublicClientApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface IPublicClientApplication {
/** Acquires a token silently when a user specifies the account the token is requested for */
acquireTokenSilent(
request: SilentFlowRequest
): Promise<AuthenticationResult | null>;
): Promise<AuthenticationResult>;

/** Acquires a token by exchanging the refresh token provided for a new set of tokens */
acquireTokenByRefreshToken(
Expand Down
2 changes: 1 addition & 1 deletion lib/msal-node/src/client/PublicClientApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class PublicClientApplication
*/
async acquireTokenSilent(
request: SilentFlowRequest
): Promise<AuthenticationResult | null> {
): Promise<AuthenticationResult> {
const correlationId =
request.correlationId || this.cryptoProvider.createNewGuid();
this.logger.trace("acquireTokenSilent called", correlationId);
Expand Down
2 changes: 1 addition & 1 deletion samples/msal-angular-v3-samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Current available samples for `@azure/msal-angular`:

* [Angular 15](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v2-samples/angular15-sample-app)
* [Angular 15](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular15-sample-app)
* Consenting to scopes: This sample consents to scopes upfront. See our [configuration doc](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/v2-docs/configuration.md) for more information.
* `MsalRedirectComponent`: This sample uses the `MsalRedirectComponent` to handle redirects. See our doc on [redirects](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/redirects.md) for more information.
* `PathLocationStrategy`: This sample uses the `PathLocationStrategy` for routing. See [Angular docs](https://angular.io/guide/router#locationstrategy-and-browser-url-styles) for more details.
Expand Down

0 comments on commit 39c4d55

Please sign in to comment.