Skip to content

Commit

Permalink
fix(Auth): Adding credentialsProvider to Cognito clients (#3745)
Browse files Browse the repository at this point in the history
* fix(Auth): Adding credentialsProvider to Cognito clients

* revert making the credentials provider initializer public
  • Loading branch information
harsh62 authored Jun 11, 2024
1 parent b02045c commit c719161
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import Foundation
@_spi(InternalAmplifyConfiguration) import Amplify

import AWSCognitoIdentity
import AWSCognitoIdentityProvider
import AWSPluginsCore
Expand Down Expand Up @@ -112,6 +111,9 @@ extension AWSCognitoAuthPlugin {
configuration.retryStrategyOptions = RetryStrategyOptions(maxRetriesBase: Int(maxRetryUnwrapped))
}

let authService = AWSAuthService()
configuration.credentialsProvider = authService.getCredentialsProvider()

return CognitoIdentityProviderClient(config: configuration)
default:
fatalError()
Expand All @@ -134,6 +136,9 @@ extension AWSCognitoAuthPlugin {
configuration.retryStrategyOptions = RetryStrategyOptions(maxRetriesBase: Int(maxRetryUnwrapped))
}

let authService = AWSAuthService()
configuration.credentialsProvider = authService.getCredentialsProvider()

return CognitoIdentityClient(config: configuration)
default:
fatalError()
Expand Down

0 comments on commit c719161

Please sign in to comment.