Skip to content

Commit

Permalink
Merge pull request #38 from quinnturner/fix/auth-url-encoding
Browse files Browse the repository at this point in the history
fix(auth): Remove Discord callback url encoding
  • Loading branch information
quinnturner committed Jun 14, 2020
2 parents 6b6b009 + 1e6f28d commit b962f93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web-api/src/services/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { getReferralTier } from './referral';
import { getUser } from './user';

const DiscordRedirectUri = encodeURIComponent(process.env.DISCORD_REDIRECT);
const DiscordRedirectUri = process.env.DISCORD_REDIRECT;
const DiscordPermissionsParam = DISCORD_PERMISSIONS.join('%20');
const DiscordPermissionsSpaceDelimited = DISCORD_PERMISSIONS.join(' ');

Expand All @@ -32,7 +32,7 @@ const getDiscordRedirectUri = (host: string) => {
}
// In staging environments and local environments, meh.
const prefix = process.env.NODE_ENV === 'production' ? 'https' : 'http';
return encodeURIComponent(`${prefix}://${host}/api/auth/discord/callback`);
return `${prefix}://${host}/api/auth/discord/callback`;
};

const DiscordOAuth2Url = (state: string, host: string) => {
Expand Down

0 comments on commit b962f93

Please sign in to comment.