2022-04-26 23:48:42 -05:00
|
|
|
import path from 'path';
|
|
|
|
|
2022-05-11 23:17:17 -05:00
|
|
|
import { ConnectorMetadata, ConnectorType, ConnectorPlatform } from '@logto/connector-types';
|
2022-04-26 23:48:42 -05:00
|
|
|
import { getFileContents } from '@logto/shared';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Note: If you do not include a version number we will default to the oldest available version, so it's recommended to include the version number in your requests.
|
|
|
|
* https://developers.facebook.com/docs/graph-api/overview#versions
|
|
|
|
*/
|
|
|
|
export const authorizationEndpoint = 'https://www.facebook.com/v13.0/dialog/oauth';
|
|
|
|
export const accessTokenEndpoint = 'https://graph.facebook.com/v13.0/oauth/access_token';
|
|
|
|
/**
|
|
|
|
* Note: The /me node is a special endpoint that translates to the object ID of the person or Page whose access token is currently being used to make the API calls.
|
|
|
|
* https://developers.facebook.com/docs/graph-api/overview#me
|
|
|
|
* https://developers.facebook.com/docs/graph-api/reference/user#Reading
|
|
|
|
*/
|
|
|
|
export const userInfoEndpoint = 'https://graph.facebook.com/v13.0/me';
|
|
|
|
export const scope = 'email,public_profile';
|
|
|
|
|
|
|
|
// eslint-disable-next-line unicorn/prefer-module
|
|
|
|
const currentPath = __dirname;
|
|
|
|
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
|
|
|
|
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
|
|
|
|
const readmeContentFallback = 'Please check README.md file directory.';
|
|
|
|
const configTemplateFallback = 'Please check config-template.md file directory.';
|
|
|
|
|
|
|
|
export const defaultMetadata: ConnectorMetadata = {
|
2022-05-11 23:17:17 -05:00
|
|
|
target: 'facebook',
|
2022-04-26 23:48:42 -05:00
|
|
|
type: ConnectorType.Social,
|
2022-05-23 04:54:05 -05:00
|
|
|
platform: ConnectorPlatform.Universal,
|
2022-04-26 23:48:42 -05:00
|
|
|
name: {
|
2022-05-19 04:31:32 -05:00
|
|
|
en: 'Facebook',
|
|
|
|
'zh-CN': 'Facebook',
|
2022-04-26 23:48:42 -05:00
|
|
|
},
|
2022-05-22 23:44:42 -05:00
|
|
|
logo: 'https://gist.githubusercontent.com/darcyYe/31bc893a0a305dc43cf831bf0b14f0fc/raw/faf985d3fbeed88180b8f3cb709892320d66ae45/facebook.svg',
|
2022-04-26 23:48:42 -05:00
|
|
|
description: {
|
|
|
|
en: 'Sign In with Facebook',
|
|
|
|
'zh-CN': 'Facebook 登录',
|
|
|
|
},
|
|
|
|
readme: getFileContents(pathToReadmeFile, readmeContentFallback),
|
|
|
|
configTemplate: getFileContents(pathToConfigTemplate, configTemplateFallback),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const defaultTimeout = 5000;
|