refactor(#89): Address PR comments

This commit is contained in:
Josh Creek
2026-01-24 17:18:57 +00:00
parent ab82f75dc6
commit 8141bd624b
6 changed files with 54 additions and 13 deletions
@@ -31,7 +31,10 @@ export const GET = async (event: RequestEvent) => {
const env = getEnv();
const clientId = env.GOOGLE_OAUTH_CLIENT_ID;
if (!clientId) {
throw redirect(302, `/pokedex/${pokedexId}?export=google-missing-client`);
const missingClientRedirect = pokedexId
? `/pokedex/${pokedexId}?export=google-missing-client`
: '/pokedex?export=google-missing-client';
throw redirect(302, missingClientRedirect);
}
const state = createOAuthState();