Skip to content

Commit

Permalink
Replaced "process.env.BASE_URL" with ""import.meta.env.VITE_SITE_DOMA…
Browse files Browse the repository at this point in the history
…IN" (#1858)

* Add trustedDependencies

* Replaced "process.env.BASE_URL" with ""import.meta.env.VITE_SITE_DOMAIN"
- Issue Link: #1850

* biome linting fixes

* Matched trustedDependencies to rewrite branch & rebuilt bun lock file

---------

Co-authored-by: Kalle <38327916+Sendouc@users.noreply.github.com>
  • Loading branch information
ElementUser and Sendouc authored Aug 29, 2024
1 parent a35d99f commit bb7f9bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/features/auth/core/DiscordStrategy.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@ function authEnvVars() {
if (process.env.NODE_ENV === "production") {
invariant(process.env.DISCORD_CLIENT_ID);
invariant(process.env.DISCORD_CLIENT_SECRET);
invariant(process.env.BASE_URL);
invariant(import.meta.env.VITE_SITE_DOMAIN);

return {
DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID,
DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET,
BASE_URL: process.env.BASE_URL,
BASE_URL: import.meta.env.VITE_SITE_DOMAIN,
};
}

// allow running the project in development without setting auth env vars
return {
DISCORD_CLIENT_ID: process.env.DISCORD_CLIENT_ID ?? "",
DISCORD_CLIENT_SECRET: process.env.DISCORD_CLIENT_SECRET ?? "",
BASE_URL: process.env.BASE_URL ?? "",
BASE_URL: import.meta.env.VITE_SITE_DOMAIN ?? "",
};
}
2 changes: 1 addition & 1 deletion app/features/tournament/TournamentRepository.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export async function findById(id: number) {
...result,
logoSrc: result.logoUrl
? userSubmittedImage(result.logoUrl)
: `${process.env.BASE_URL}${HACKY_resolvePicture(result)}`,
: `${import.meta.env.VITE_SITE_DOMAIN}${HACKY_resolvePicture(result)}`,
participatedUsers: result.participatedUsers.map((user) => user.userId),
};
}
Expand Down

0 comments on commit bb7f9bc

Please sign in to comment.