Skip to content

Commit f2c17b8

Browse files
committed
check if cache is being returned
1 parent 2be7f2f commit f2c17b8

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

packages/core/src/auth/auth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,8 @@ export class Auth implements AuthService, ConnectionManager {
903903
private async _getCredentials(id: Connection['id'], provider: CredentialsProvider): Promise<Credentials> {
904904
const credentials = await this.getCachedCredentials(provider)
905905
if (credentials !== undefined) {
906+
//eslint-disable-next-line aws-toolkits/no-console-log
907+
console.log('returning cached credentials')
906908
return credentials
907909
} else if ((await provider.canAutoConnect()) === true) {
908910
return this.createCachedCredentials(provider)

packages/core/src/shared/credentials/userCredentialsUtils.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,10 @@ export class UserCredentialsUtils {
9292
const contents = credentialsContext ? ['', createNewCredentialsFile(credentialsContext)] : []
9393

9494
if (await fs.exists(dest)) {
95-
//eslint-disable-next-line aws-toolkits/no-console-log
96-
console.log('hit case where dest exists')
9795
contents.unshift(await fs.readFileText(dest))
9896
} else {
99-
//eslint-disable-next-line aws-toolkits/no-console-log
100-
console.log('hit case where dest exists')
10197
contents.unshift(header)
10298
}
103-
//eslint-disable-next-line aws-toolkits/no-console-log
104-
console.log('contents=%O', contents)
10599
await fs.writeFile(dest, contents.join('\n'))
106100
}
107101
}

packages/core/src/test/credentials/auth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ describe('Auth', function () {
528528
const newCreds = { ...initialCreds, accessKey: 'y', secretKey: 'y' }
529529
await UserCredentialsUtils.generateCredentialsFile(newCreds)
530530
console.log('file exists after generating=%O', await fs.exists(getCredentialsFilename()))
531-
console.log('file contents = %O', await fs.readFileText(getCredentialsFilename()))
531+
532532
assert.deepStrictEqual(await conn.getCredentials(), {
533533
accessKeyId: newCreds.accessKey,
534534
secretAccessKey: newCreds.secretKey,

0 commit comments

Comments
 (0)