From 7caf11c989f91d1496491e7955744a3a98de58dc Mon Sep 17 00:00:00 2001 From: Michael Law <1365977+lawmicha@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:03:50 -0400 Subject: [PATCH] fix(storage): retrieve accesslevel before storage service (#3641) --- .../AWSS3StoragePlugin/AWSS3StoragePlugin+Configure.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/AWSS3StoragePlugin+Configure.swift b/AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/AWSS3StoragePlugin+Configure.swift index f6ee4f1a7d..9b40e63906 100644 --- a/AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/AWSS3StoragePlugin+Configure.swift +++ b/AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/AWSS3StoragePlugin+Configure.swift @@ -37,6 +37,7 @@ extension AWSS3StoragePlugin { do { let authService = AWSAuthService() + let defaultAccessLevel = try configClosures.retrieveDefaultAccessLevel() let storageService = try AWSS3StorageService(authService: authService, region: configClosures.retrieveRegion(), bucket: configClosures.retrieveBucket(), @@ -45,7 +46,7 @@ extension AWSS3StoragePlugin { configure(storageService: storageService, authService: authService, - defaultAccessLevel: try configClosures.retrieveDefaultAccessLevel()) + defaultAccessLevel: defaultAccessLevel) } catch let storageError as StorageError { throw storageError } catch {