Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-facebook-auth

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-facebook-auth - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

dist/react-facebook-auth.js

@@ -244,3 +244,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

return _react2.default.createElement(Component, { onClick: this.click });
return _react2.default.createElement(Component, _extends({ onClick: this.click }, this.props.customProps));
}

@@ -247,0 +247,0 @@ }]);

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("ReactFacebookAuth",["react"],t):"object"==typeof exports?exports.ReactFacebookAuth=t(require("react")):e.ReactFacebookAuth=t(e.React)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=function(){function e(e,t){for(var n=0;t.length>n;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(3),s=function(e){return e&&e.__esModule?e:{default:e}}(u),f=n(2),l=function(e){function t(){var e,n,i,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;u>l;l++)s[l]=arguments[l];return n=i=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),i.responseApi=function(e){window.FB.api("/me",{locale:i.props.language,fields:i.props.fields},function(t){i.props.callback(c({},t,e))})},i.checkLoginState=function(e){if(e.authResponse)return void i.responseApi(e.authResponse);i.props.callback&&i.props.callback({status:e.status})},i.checkLoginAfterRefresh=function(e){"unknown"===e.status?window.FB.login(function(e){return i.checkLoginState(e)},!0):i.checkLoginState(e)},i.click=function(){var e=i.props,t=e.scope,n=e.appId,o=e.onClick,r=e.reAuthenticate,c=e.redirectUri,a=e.disableRedirect,u=e.isMobile;"function"==typeof o&&o();var s={client_id:n,redirect_uri:c,state:"facebookdirect",scope:t};r&&(s.auth_type="reauthenticate"),u&&!a?window.location.href="//www.facebook.com/dialog/oauth?"+(0,f.toQueryString)(s):window.FB.login(i.checkLoginState,{scope:t,auth_type:s.auth_type})},a=n,r(i,a)}return i(t,e),a(t,[{key:"componentDidMount",value:function(){if(!document.getElementById("facebook-jssdk")){this.setfbAsyncInit(),this.loadSdkAsynchronously();var e=document.getElementById("fb-root");e||(e=document.createElement("div"),e.id="fb-root",document.body.appendChild(e))}}},{key:"setfbAsyncInit",value:function(){var e=this,t=this.props,n=t.appId,o=t.xfbml,r=t.cookie,i=t.version,c=t.autoLoad;window.fbAsyncInit=function(){window.FB.init({version:"v"+i,appId:n,xfbml:o,cookie:r}),(c||window.location.search.includes("facebookdirect"))&&window.FB.getLoginStatus(e.checkLoginAfterRefresh)}}},{key:"loadSdkAsynchronously",value:function(){var e=this.props.language;!function(t,n,o){var r=t.getElementsByTagName(n)[0],i=r,c=r;t.getElementById(o)||(c=t.createElement(n),c.id=o,c.src="//connect.facebook.net/"+e+"/all.js",i.parentNode.insertBefore(c,i))}(document,"script","facebook-jssdk")}},{key:"render",value:function(){return s.default.createElement(this.props.component,{onClick:this.click})}}]),t}(s.default.Component);l.defaultProps={redirectUri:"undefined"!=typeof window?window.location.href:"/",scope:"public_profile,email",xfbml:!1,cookie:!1,isMobile:(0,f.isMobile)(),reAuthenticate:!1,fields:"name",version:"2.8",language:"en_US",autoLoad:!1,disableRedirect:!1},t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(0);t.default=function(e){return e&&e.__esModule?e:{default:e}}(o).default,e.exports=t.default},function(e,t,n){"use strict";function o(e){return Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function r(){try{return!!(window.navigator&&window.navigator.standalone||navigator.userAgent.match("CriOS")||navigator.userAgent.match(/mobile/i))}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.toQueryString=o,t.isMobile=r},function(t,n){t.exports=e}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("ReactFacebookAuth",["react"],t):"object"==typeof exports?exports.ReactFacebookAuth=t(require("react")):e.ReactFacebookAuth=t(e.React)}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},a=function(){function e(e,t){for(var o=0;t.length>o;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),u=o(3),s=function(e){return e&&e.__esModule?e:{default:e}}(u),f=o(2),l=function(e){function t(){var e,o,i,a;n(this,t);for(var u=arguments.length,s=Array(u),l=0;u>l;l++)s[l]=arguments[l];return o=i=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),i.responseApi=function(e){window.FB.api("/me",{locale:i.props.language,fields:i.props.fields},function(t){i.props.callback(c({},t,e))})},i.checkLoginState=function(e){if(e.authResponse)return void i.responseApi(e.authResponse);i.props.callback&&i.props.callback({status:e.status})},i.checkLoginAfterRefresh=function(e){"unknown"===e.status?window.FB.login(function(e){return i.checkLoginState(e)},!0):i.checkLoginState(e)},i.click=function(){var e=i.props,t=e.scope,o=e.appId,n=e.onClick,r=e.reAuthenticate,c=e.redirectUri,a=e.disableRedirect,u=e.isMobile;"function"==typeof n&&n();var s={client_id:o,redirect_uri:c,state:"facebookdirect",scope:t};r&&(s.auth_type="reauthenticate"),u&&!a?window.location.href="//www.facebook.com/dialog/oauth?"+(0,f.toQueryString)(s):window.FB.login(i.checkLoginState,{scope:t,auth_type:s.auth_type})},a=o,r(i,a)}return i(t,e),a(t,[{key:"componentDidMount",value:function(){if(!document.getElementById("facebook-jssdk")){this.setfbAsyncInit(),this.loadSdkAsynchronously();var e=document.getElementById("fb-root");e||(e=document.createElement("div"),e.id="fb-root",document.body.appendChild(e))}}},{key:"setfbAsyncInit",value:function(){var e=this,t=this.props,o=t.appId,n=t.xfbml,r=t.cookie,i=t.version,c=t.autoLoad;window.fbAsyncInit=function(){window.FB.init({version:"v"+i,appId:o,xfbml:n,cookie:r}),(c||window.location.search.includes("facebookdirect"))&&window.FB.getLoginStatus(e.checkLoginAfterRefresh)}}},{key:"loadSdkAsynchronously",value:function(){var e=this.props.language;!function(t,o,n){var r=t.getElementsByTagName(o)[0],i=r,c=r;t.getElementById(n)||(c=t.createElement(o),c.id=n,c.src="//connect.facebook.net/"+e+"/all.js",i.parentNode.insertBefore(c,i))}(document,"script","facebook-jssdk")}},{key:"render",value:function(){return s.default.createElement(this.props.component,c({onClick:this.click},this.props.customProps))}}]),t}(s.default.Component);l.defaultProps={redirectUri:"undefined"!=typeof window?window.location.href:"/",scope:"public_profile,email",xfbml:!1,cookie:!1,isMobile:(0,f.isMobile)(),reAuthenticate:!1,fields:"name",version:"2.8",language:"en_US",autoLoad:!1,disableRedirect:!1},t.default=l,e.exports=t.default},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(0);t.default=function(e){return e&&e.__esModule?e:{default:e}}(n).default,e.exports=t.default},function(e,t,o){"use strict";function n(e){return Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function r(){try{return!!(window.navigator&&window.navigator.standalone||navigator.userAgent.match("CriOS")||navigator.userAgent.match(/mobile/i))}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.toQueryString=n,t.isMobile=r},function(t,o){t.exports=e}])});

@@ -161,3 +161,3 @@ 'use strict';

return _react2.default.createElement(Component, { onClick: this.click });
return _react2.default.createElement(Component, _extends({ onClick: this.click }, this.props.customProps));
}

@@ -164,0 +164,0 @@ }]);

@@ -161,3 +161,3 @@ 'use strict';

return _react2.default.createElement(Component, { onClick: this.click });
return _react2.default.createElement(Component, _extends({ onClick: this.click }, this.props.customProps));
}

@@ -164,0 +164,0 @@ }]);

{
"name": "react-facebook-auth",
"version": "1.1.0",
"version": "1.2.0",
"description": "A Component React for Facebook authentication",

@@ -5,0 +5,0 @@ "author": "Ionut Milica <ionut.milica@gmail.com>",

@@ -21,2 +21,3 @@ import React from 'react';

language: PropTypes.string,
customProps: PropTypes.object
};

@@ -160,3 +161,3 @@ static defaultProps = {

const { component: Component } = this.props;
return <Component onClick={this.click} />;
return <Component onClick={this.click} {...this.props.customProps} />;
}

@@ -163,0 +164,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc