Skip to content

Commit d8c4834

Browse files
committed
await shutdown
1 parent d71e01f commit d8c4834

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Sources/App/Core/Cognito.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ struct Cognito {
1818
)
1919
req.application.cognito.authenticatable = CognitoAuthenticatable(configuration: awsCognitoConfiguration)
2020
let response = try await req.application.cognito.authenticatable.authenticate(username: username, password: password)
21-
try awsClient.syncShutdown()
21+
try await awsClient.shutdown()
2222
return response
2323
} catch {
24-
try awsClient.syncShutdown()
24+
try await awsClient.shutdown()
2525
throw error
2626
}
2727
}
@@ -39,9 +39,9 @@ struct Cognito {
3939
)
4040
req.application.cognito.authenticatable = CognitoAuthenticatable(configuration: awsCognitoConfiguration)
4141
let _ = try await req.application.cognito.authenticatable.authenticate(accessToken: sessionID, on: req.eventLoop)
42-
try awsClient.syncShutdown()
42+
try await awsClient.shutdown()
4343
} catch {
44-
try awsClient.syncShutdown()
44+
try await awsClient.shutdown()
4545
throw error
4646
}
4747
}
@@ -59,9 +59,9 @@ struct Cognito {
5959
)
6060
req.application.cognito.authenticatable = CognitoAuthenticatable(configuration: awsCognitoConfiguration)
6161
_ = try await req.application.cognito.authenticatable.signUp(username: username, password: password, attributes: [:], on:req.eventLoop)
62-
try awsClient.syncShutdown()
62+
try await awsClient.shutdown()
6363
} catch {
64-
try awsClient.syncShutdown()
64+
try await awsClient.shutdown()
6565
throw error
6666
}
6767
}
@@ -79,9 +79,9 @@ struct Cognito {
7979
)
8080
req.application.cognito.authenticatable = CognitoAuthenticatable(configuration: awsCognitoConfiguration)
8181
try await req.application.cognito.authenticatable.forgotPassword(username: username)
82-
try awsClient.syncShutdown()
82+
try await awsClient.shutdown()
8383
} catch {
84-
try awsClient.syncShutdown()
84+
try await awsClient.shutdown()
8585
throw error
8686
}
8787
}
@@ -99,9 +99,9 @@ struct Cognito {
9999
)
100100
req.application.cognito.authenticatable = CognitoAuthenticatable(configuration: awsCognitoConfiguration)
101101
try await req.application.cognito.authenticatable.confirmForgotPassword(username: username, newPassword: password, confirmationCode: confirmationCode)
102-
try awsClient.syncShutdown()
102+
try await awsClient.shutdown()
103103
} catch {
104-
try awsClient.syncShutdown()
104+
try await awsClient.shutdown()
105105
throw error
106106
}
107107
}
@@ -119,9 +119,9 @@ struct Cognito {
119119
)
120120
req.application.cognito.authenticatable = CognitoAuthenticatable(configuration: awsCognitoConfiguration)
121121
try await req.application.cognito.authenticatable.confirmSignUp(username: username, confirmationCode: confirmationCode)
122-
try awsClient.syncShutdown()
122+
try await awsClient.shutdown()
123123
} catch {
124-
try awsClient.syncShutdown()
124+
try await awsClient.shutdown()
125125
throw error
126126
}
127127
}
@@ -140,9 +140,9 @@ struct Cognito {
140140
req.application.cognito.authenticatable = CognitoAuthenticatable(configuration: awsCognitoConfiguration)
141141
let request = try CognitoIdentityProvider.DeleteUserRequest(accessToken: req.auth.require(AuthenticatedUser.self).sessionID)
142142
try await req.application.cognito.authenticatable.configuration.cognitoIDP.deleteUser(request)
143-
try awsClient.syncShutdown()
143+
try await awsClient.shutdown()
144144
} catch {
145-
try awsClient.syncShutdown()
145+
try await awsClient.shutdown()
146146
throw error
147147
}
148148
}

0 commit comments

Comments
 (0)