diff --git a/src/providers/facebook.ts b/src/providers/facebook.ts index 09d97de..b77cf15 100644 --- a/src/providers/facebook.ts +++ b/src/providers/facebook.ts @@ -19,10 +19,10 @@ export interface FacebookTokens { interface FacebookOAuth2ProviderConfig extends OAuth2ProviderConfig { - userProfileFields?: string | (keyof FacebookProfile | string)[]; + userProfileFields?: string | (keyof ProfileType)[] | (string | number | symbol)[]; } -const defaultConfig: Partial = { +const defaultConfig: Partial> = { id: "facebook", scope: ["email", "public_profile", "user_link"], userProfileFields: [ @@ -41,12 +41,12 @@ const defaultConfig: Partial = { accessTokenUrl: "https://graph.facebook.com/v10.0/oauth/access_token", }; -export class FacebookOAuth2Provider extends OAuth2Provider< - FacebookProfile, +export class FacebookOAuth2Provider extends OAuth2Provider< + ProfileType, FacebookTokens, - FacebookOAuth2ProviderConfig + FacebookOAuth2ProviderConfig > { - constructor(config: FacebookOAuth2ProviderConfig) { + constructor(config: FacebookOAuth2ProviderConfig) { const userProfileFields = config.userProfileFields ?? defaultConfig.userProfileFields; const data = { fields: Array.isArray(userProfileFields) ? userProfileFields.join(",") : userProfileFields!,