react-es-fb-login 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -57,7 +57,7 @@ exports.FacebookLoginClient = {
|
|
|
57
57
|
isRedirected(dialogParams) {
|
|
58
58
|
var _a, _b;
|
|
59
59
|
const params = (0, helpers_1.paramsToObject)(window.location.search);
|
|
60
|
-
return ((
|
|
60
|
+
return ((params['state'] === ((_a = dialogParams === null || dialogParams === void 0 ? void 0 : dialogParams.state) !== null && _a !== void 0 ? _a : 'facebookdirect')) &&
|
|
61
61
|
params[(_b = dialogParams === null || dialogParams === void 0 ? void 0 : dialogParams.response_type) !== null && _b !== void 0 ? _b : ''] !== undefined);
|
|
62
62
|
},
|
|
63
63
|
loadSdk(language, useCustomerChat) {
|
package/dist/facebook-login.d.ts
CHANGED
package/dist/facebook-login.js
CHANGED
|
@@ -35,10 +35,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
35
35
|
const react_1 = __importStar(require("react"));
|
|
36
36
|
const facebook_login_client_1 = require("./facebook-login.client");
|
|
37
37
|
const helpers_1 = require("./helpers");
|
|
38
|
-
|
|
38
|
+
const FacebookLogin = (props) => {
|
|
39
39
|
var _a, _b;
|
|
40
|
-
const { appId, language = 'en_US',
|
|
41
|
-
const initParams = Object.assign(Object.assign({ version: '
|
|
40
|
+
const { appId, style, onFail, render, onSuccess, className, autoLoad = false, onProfileSuccess, language = 'en_US', useRedirect = false, useCustomerChat = false, fields = 'name,email,picture', scope = 'public_profile, email', children = 'Login with Facebook', } = props;
|
|
41
|
+
const initParams = Object.assign(Object.assign({ version: 'v17.0', xfbml: false, cookie: false, localStorage: true }, props.initParams), { appId });
|
|
42
42
|
const dialogParams = Object.assign(Object.assign({ redirect_uri: typeof window !== 'undefined' ? location.origin + location.pathname : '/', state: 'facebookdirect', response_type: 'code' }, props.dialogParams), { client_id: appId });
|
|
43
43
|
const loginOptions = Object.assign(Object.assign({ return_scopes: false, ignoreSdkError: false }, props.loginOptions), { auth_nonce: typeof ((_a = props.loginOptions) === null || _a === void 0 ? void 0 : _a.auth_nonce) === 'function'
|
|
44
44
|
? props.loginOptions.auth_nonce()
|
|
@@ -46,7 +46,7 @@ function FacebookLogin(props) {
|
|
|
46
46
|
(0, react_1.useEffect)(() => {
|
|
47
47
|
init();
|
|
48
48
|
}, []);
|
|
49
|
-
const init = () => __awaiter(
|
|
49
|
+
const init = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
50
|
yield facebook_login_client_1.FacebookLoginClient.loadSdk(language, useCustomerChat);
|
|
51
51
|
window.fbAsyncInit = () => {
|
|
52
52
|
facebook_login_client_1.FacebookLoginClient.init(initParams);
|
|
@@ -89,6 +89,6 @@ function FacebookLogin(props) {
|
|
|
89
89
|
logout: facebook_login_client_1.FacebookLoginClient.logout,
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
return (react_1.default.createElement("button", { type: "button",
|
|
93
|
-
}
|
|
92
|
+
return (react_1.default.createElement("button", { type: "button", style: style, className: className, onClick: handleButtonClick }, children));
|
|
93
|
+
};
|
|
94
94
|
exports.default = FacebookLogin;
|
|
@@ -8,7 +8,7 @@ export type InitParams = {
|
|
|
8
8
|
*
|
|
9
9
|
* (available versions: https://developers.facebook.com/docs/graph-api/changelog)
|
|
10
10
|
* @default 'v9.0' */
|
|
11
|
-
version?: 'v7.0' | 'v8.0' | 'v9.0' | 'v10.0' | 'v11.0' | 'v12.0' | 'v13.0' | 'v14.0' | 'v15.0' | 'v16.0' | 'v17.0';
|
|
11
|
+
version?: 'v7.0' | 'v8.0' | 'v9.0' | 'v10.0' | 'v11.0' | 'v12.0' | 'v13.0' | 'v14.0' | 'v15.0' | 'v16.0' | 'v17.0' | 'v18.0' | 'v19.0' | 'v20.0' | 'v21.0' | 'v22.0' | 'v23.0' | 'v24.0' | 'v25.0' | 'v26.0' | 'v27.0' | 'v28.0' | 'v29.0' | 'v30.0' | 'v31.0' | 'v32.0' | 'v33.0' | 'v34.0' | 'v35.0' | 'v36.0';
|
|
12
12
|
/** Determines whether a cookie is created for the session or not. If enabled, it can be accessed by server-side code.
|
|
13
13
|
* @default false */
|
|
14
14
|
cookie?: boolean;
|
|
@@ -69,7 +69,12 @@ export type LoginOptions = {
|
|
|
69
69
|
* @default false */
|
|
70
70
|
ignoreSdkError?: boolean;
|
|
71
71
|
extras?: {
|
|
72
|
-
|
|
72
|
+
version?: 'v1' | 'v2' | 'v3' | 'v4' | 'v5';
|
|
73
|
+
featureType?: string;
|
|
74
|
+
features?: {
|
|
75
|
+
name: string;
|
|
76
|
+
}[];
|
|
77
|
+
setup?: unknown;
|
|
73
78
|
};
|
|
74
79
|
};
|
|
75
80
|
export type FacebookLoginProps = Pick<InitParams, 'appId'> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-es-fb-login",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react",
|
|
6
6
|
"reactjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Evolve-Next/react-facebook-login",
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
34
|
+
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "7.23.3",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"@testing-library/react": "14.1.0",
|
|
41
41
|
"@types/jest": "29.5.8",
|
|
42
42
|
"@types/node": "20.9.1",
|
|
43
|
-
"@types/react": "18.
|
|
43
|
+
"@types/react": "18.0.28",
|
|
44
|
+
"@types/react-dom": "^18.0.11",
|
|
44
45
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
45
46
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
46
47
|
"@typescript-eslint/parser": "5.62.0",
|