mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
fixing typescript error
This commit is contained in:
parent
2b17aad9a7
commit
22aea5ec6e
1 changed files with 14 additions and 3 deletions
|
|
@ -17,9 +17,20 @@ async function getTemporaryCredentials() {
|
|||
region: process.env.PRESIGN_AWS_REGION,
|
||||
});
|
||||
|
||||
// Request temporary credentials with GetSessionToken
|
||||
const data = await sts.getSessionToken({ DurationSeconds: 900 }).promise(); // Token valid for 15 minutes
|
||||
return data.Credentials;
|
||||
try {
|
||||
// Request temporary credentials with GetSessionToken
|
||||
const data = await sts.getSessionToken({ DurationSeconds: 900 }).promise(); // Token valid for 15 minutes
|
||||
|
||||
// Check if credentials are present
|
||||
if (!data.Credentials) {
|
||||
throw new Error("Failed to retrieve temporary credentials");
|
||||
}
|
||||
|
||||
return data.Credentials;
|
||||
} catch (error) {
|
||||
console.error("Error fetching temporary credentials:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// API handler
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue