Skip to content

Commit

Permalink
revert making the credentials provider initializer public
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh62 committed Jun 10, 2024
1 parent 4c9cec5 commit 86b68b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ extension AWSCognitoAuthPlugin {
configuration.retryStrategyOptions = RetryStrategyOptions(maxRetriesBase: Int(maxRetryUnwrapped))
}

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

return CognitoIdentityProviderClient(config: configuration)
default:
Expand All @@ -135,7 +136,8 @@ extension AWSCognitoAuthPlugin {
configuration.retryStrategyOptions = RetryStrategyOptions(maxRetriesBase: Int(maxRetryUnwrapped))
}

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

return CognitoIdentityClient(config: configuration)
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import Foundation

public class AmplifyAWSCredentialsProvider: AWSClientRuntime.CredentialsProviding {

public init() { }

public func getCredentials() async throws -> AWSClientRuntime.AWSCredentials {
let authSession = try await Amplify.Auth.fetchAuthSession()
if let awsCredentialsProvider = authSession as? AuthAWSCredentialsProvider {
Expand Down

0 comments on commit 86b68b7

Please sign in to comment.