Skip to content

Commit

Permalink
add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Hweinstock committed Nov 12, 2024
1 parent 3c43115 commit fa8c103
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/core/src/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,14 @@ export class Auth implements AuthService, ConnectionManager {
//eslint-disable-next-line aws-toolkits/no-console-log
console.log('getCachedCredentials called')
const creds = await globals.loginManager.store.getCredentials(provider.getCredentialsId())
//eslint-disable-next-line aws-toolkits/no-console-log
console.log(
'provider hash is same as credentials has: %O',
creds?.credentialsHashCode === provider.getHashCode()
)
if (creds !== undefined && creds.credentialsHashCode === provider.getHashCode()) {
//eslint-disable-next-line aws-toolkits/no-console-log
console.log('returning cached credentials')
return creds.credentials
}
}
Expand Down Expand Up @@ -918,13 +925,17 @@ export class Auth implements AuthService, ConnectionManager {
//eslint-disable-next-line aws-toolkits/no-console-log
console.log('_getCredentials called')
const credentials = await this.getCachedCredentials(provider)
//eslint-disable-next-line aws-toolkits/no-console-log
console.log('credentials is undefined: %O', credentials === undefined)
if (credentials !== undefined) {
//eslint-disable-next-line aws-toolkits/no-console-log
console.log('returning cached credentials')
return credentials
} else if ((await provider.canAutoConnect()) === true) {
return this.createCachedCredentials(provider)
} else {
//eslint-disable-next-line aws-toolkits/no-console-log
console.log('hit case with handleInvalidCredentials')
return this.handleInvalidCredentials(id, () => this.createCachedCredentials(provider))
}
}
Expand Down

0 comments on commit fa8c103

Please sign in to comment.