Skip to content

Commit 46c6c07

Browse files
committed
remove unnecessary comments
1 parent 798ccfb commit 46c6c07

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

src/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,9 @@ function refreshAccessToken() {
9696
}
9797
})
9898
.catch((error) => {
99-
// Only log errors that aren't interaction required
10099
if (!(error instanceof InteractionRequiredAuthError)) {
101100
throw new Error(`Error refreshing access token: ${error}`);
102101
}
103-
// Other errors are ignored as they require user interaction
104102
});
105103
}
106104
refreshAccessToken();

src/modules/authentication/AuthenticationWrapper.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ describe('AuthenticationWrapper should', () => {
104104
return originalGetItem.call(window.localStorage, key);
105105
});
106106

107-
// Call the method under test
108107
authenticationWrapper.clearCache();
109108

110109
// Verify removeItem was called with the expected key
@@ -138,7 +137,6 @@ describe('AuthenticationWrapper should', () => {
138137
expect(logIn.account!.homeAccountId).toBe('homeAccountId');
139138
});
140139

141-
// For other tests that need accounts to be present
142140
it('get consented scopes along with a valid homeAccountId as returned by the auth call', async () => {
143141
const { msalApplication } = require('./msal-app.ts');
144142
msalApplication.getAllAccounts.mockReturnValue([mockAccount]);

src/modules/authentication/AuthenticationWrapper.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,12 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {
163163
try {
164164
// Attempt silent acquisition
165165
const result = await msalApplication.acquireTokenSilent(silentRequest);
166-
// If successful, store the account ID as it's now the active one
167166
this.storeHomeAccountId(result.account!);
168167
return result;
169168
} catch (error) {
170-
// If silent fails (e.g., requires interaction, expired), throw error.
171169
throw new Error(`Silent token acquisition failed for cached account: ${error}`);
172170
}
173171
} else {
174-
// No active account and no cached accounts - user needs to log in explicitly.
175-
// Throw error indicating login is required
176172
throw new Error('No active or cached account found. User login required.');
177173
}
178174
}
@@ -200,8 +196,7 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {
200196
throw new Error(`Silent token refresh failed, login required: ${refreshError}`);
201197
}
202198
}
203-
// Re-throw other unexpected silent errors so the caller can handle them
204-
throw error; // Removed console.error, just re-throw
199+
throw new Error(`Token acquisition failed: ${error}`);
205200
}
206201
}
207202

0 commit comments

Comments
 (0)