FEAT: passport mailchimp

This commit is contained in:
Gabriel Rosa
2022-06-27 17:50:45 -03:00
parent b584c80e24
commit 91aefe7d61
6 changed files with 34 additions and 29 deletions
+10 -1
View File
@@ -13,6 +13,7 @@ export class OauthSecrets {
hubspot = new OauthSecretsObject();
google = new OauthSecretsObject();
mailchimp = new OauthSecretsObject();
facebook = new OauthSecretsObject();
}
export async function getOauthSecrets() {
const secrets = new OauthSecrets();
@@ -25,7 +26,15 @@ export async function getOauthSecrets() {
const res = await secretsManagerClient
.send(getSecretComand)
.catch(() => null);
if (res) secrets[key] = JSON.parse(res.SecretString);
if (res) {
secrets[key] = JSON.parse(res.SecretString);
} else {
secrets[key] = {
client_id: 'id',
client_secret: 'id',
redirect_uri: 'id',
};
}
}
return secrets;
}