chore(plugin-cloud): refresh session on ExpiredToken error code
Issue: https://github.com/payloadcms/payload/issues/8404
This code will refresh the session token upon receiving an ExpiredToken error when storageClient.getObject() receives that error.
-
The
Error Codedetected is determined by the error reported in the issue, and is an actual code from AWS documentation for Error Responses. -
If the request fails again, the error is thrown.
The code is looking good. I've just triggered a canary release 3.0.0-canary.ab70b75. Please run this on a deployed cloud project and verify base functionality is still working.
Verified payloadPluginCloud() works with cognito credentials in a local env and in Payload Cloud.
🚀 This is included in version v3.25.0