Skip to content

Commit 2582b60

Browse files
committed
secrets are actually json
1 parent 050a5cb commit 2582b60

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const environmentConfig: EnvironmentConfigType = {
4747
ValidCorsOrigins: [
4848
"http://localhost:3000",
4949
"http://localhost:5173",
50+
"http://localhost:5174",
5051
"https://merch-pwa.pages.dev",
5152
"https://manage.qa.acmuiuc.org",
5253
/^https:\/\/(?:.*\.)?acmuiuc\.pages\.dev$/,

src/routes/discord.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ export const updateDiscord = async (
3232
}
3333

3434
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
35+
const secretApiConfig = (await getSecretValue("infra-core-api-config")) || {};
36+
3537
client.once(Events.ClientReady, async (readyClient: Client<true>) => {
3638
console.log(`Logged in as ${readyClient.user.tag}`);
37-
const guildID = await getSecretValue("discord_guild_id");
39+
const guildID = secretApiConfig["discord_guild_id"];
3840
const guild = await client.guilds.fetch(guildID?.toString() || "");
3941
const discordEvents = await guild.scheduledEvents.fetch();
4042
const snowflakeMeetingLookup = discordEvents.reduce(
@@ -105,6 +107,6 @@ export const updateDiscord = async (
105107
await client.destroy();
106108
});
107109

108-
const token = await getSecretValue("discord_bot_token");
110+
const token = secretApiConfig["discord_bot_token"];
109111
client.login(token?.toString());
110112
};

0 commit comments

Comments
 (0)