Skip to content

Commit

Permalink
Add default name export (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealFlyingCoder authored Dec 19, 2022
1 parent 205617a commit 84c94ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,14 @@ export interface DiscordProfile extends OAuth2Profile {
};
}

export const DiscordStrategyDefaultName = "discord";

export class DiscordStrategy<User> extends OAuth2Strategy<
User,
DiscordProfile,
DiscordExtraParams
> {
name = "discord";
name = DiscordStrategyDefaultName;

private scope: Array<DiscordScope>;
private prompt?: "none" | "consent";
Expand Down Expand Up @@ -266,7 +268,7 @@ export class DiscordStrategy<User> extends OAuth2Strategy<
const raw: DiscordProfile["__json"] = await response.json();

const profile: DiscordProfile = {
provider: "discord",
provider: DiscordStrategyDefaultName,
id: raw.id,
displayName: raw.username,
emails: raw.email ? [{ value: raw.email }] : undefined,
Expand Down

0 comments on commit 84c94ce

Please sign in to comment.