remix-auth-discord
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -14,2 +14,7 @@ import type { StrategyVerifyCallback } from "remix-auth"; | ||
/** | ||
* These are all the available Discord locales | ||
* @see https://discord.com/developers/docs/reference#locales | ||
*/ | ||
declare type DiscordLocale = "da" | "de" | "en-GB" | "en-US" | "es-ES" | "fr" | "hr" | "it" | "lt" | "hu" | "nl" | "no" | "pl" | "pt-BR" | "ro" | "fi" | "sv-SE" | "vi" | "tr" | "cs" | "el" | "bg" | "ru" | "uk" | "hi" | "th" | "zh-CN" | "ja" | "zh-TW" | "ko"; | ||
/** | ||
* This represents a Discord Guild as returned by the API with the guilds scope enabled. | ||
@@ -96,3 +101,3 @@ * @see https://discord.com/developers/docs/resources/user#get-current-user-guilds | ||
*/ | ||
locale?: string; | ||
locale?: DiscordLocale; | ||
/** | ||
@@ -123,2 +128,3 @@ * Whether the email on this account has been verified | ||
} | ||
export declare const DiscordStrategyDefaultName = "discord"; | ||
export declare class DiscordStrategy<User> extends OAuth2Strategy<User, DiscordProfile, DiscordExtraParams> { | ||
@@ -125,0 +131,0 @@ name: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiscordStrategy = void 0; | ||
exports.DiscordStrategy = exports.DiscordStrategyDefaultName = void 0; | ||
const remix_auth_oauth2_1 = require("remix-auth-oauth2"); | ||
const discordApiBaseURL = "https://discord.com/api/v10"; | ||
exports.DiscordStrategyDefaultName = "discord"; | ||
class DiscordStrategy extends remix_auth_oauth2_1.OAuth2Strategy { | ||
@@ -15,3 +16,3 @@ constructor({ clientID, clientSecret, callbackURL, scope, prompt, }, verify) { | ||
}, verify); | ||
this.name = "discord"; | ||
this.name = exports.DiscordStrategyDefaultName; | ||
this.userInfoURL = `${discordApiBaseURL}/users/@me`; | ||
@@ -37,3 +38,3 @@ this.scope = scope ? scope : ["identify", "email"]; | ||
const profile = { | ||
provider: "discord", | ||
provider: exports.DiscordStrategyDefaultName, | ||
id: raw.id, | ||
@@ -40,0 +41,0 @@ displayName: raw.username, |
{ | ||
"name": "remix-auth-discord", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"main": "./build/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./build/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16417
198