react-facebook
Advanced tools
Comparing version 4.0.13 to 4.0.14
@@ -52,3 +52,3 @@ 'use strict'; | ||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(facebook) { | ||
var _props, scope, fields, returnScopes, rerequest, loginQpts, response; | ||
var _props, scope, fields, returnScopes, rerequest, reauthorize, loginQpts, authType, response; | ||
@@ -59,4 +59,5 @@ return _regenerator2.default.wrap(function _callee$(_context) { | ||
case 0: | ||
_props = this.props, scope = _props.scope, fields = _props.fields, returnScopes = _props.returnScopes, rerequest = _props.rerequest; | ||
_props = this.props, scope = _props.scope, fields = _props.fields, returnScopes = _props.returnScopes, rerequest = _props.rerequest, reauthorize = _props.reauthorize; | ||
loginQpts = { scope: scope }; | ||
authType = []; | ||
@@ -69,13 +70,21 @@ | ||
if (rerequest) { | ||
loginQpts.auth_type = 'rerequest'; | ||
authType.push('rerequest'); | ||
} | ||
_context.next = 6; | ||
if (reauthorize) { | ||
authType.push('reauthenticate'); | ||
} | ||
if (authType.length) { | ||
loginQpts.auth_type = authType.join(','); | ||
} | ||
_context.next = 9; | ||
return facebook.login(loginQpts); | ||
case 6: | ||
case 9: | ||
response = _context.sent; | ||
if (!(response.status !== 'connected')) { | ||
_context.next = 9; | ||
_context.next = 12; | ||
break; | ||
@@ -86,6 +95,6 @@ } | ||
case 9: | ||
case 12: | ||
return _context.abrupt('return', facebook.getTokenDetailWithProfile({ fields: fields })); | ||
case 10: | ||
case 13: | ||
case 'end': | ||
@@ -108,5 +117,6 @@ return _context.stop(); | ||
scope: _propTypes2.default.string.isRequired, | ||
fields: _propTypes2.default.array.isRequired, | ||
fields: _propTypes2.default.arrayOf(_propTypes2.default.string), | ||
returnScopes: _propTypes2.default.bool, | ||
rerequest: _propTypes2.default.bool | ||
rerequest: _propTypes2.default.bool, | ||
reauthorize: _propTypes2.default.bool | ||
}), _class.defaultProps = (0, _extends3.default)({}, _Process3.default.defaultProps, { | ||
@@ -116,4 +126,5 @@ scope: '', | ||
returnScopes: false, | ||
rerequest: false | ||
rerequest: false, | ||
reauthorize: false | ||
}), _temp); | ||
exports.default = Login; |
{ | ||
"name": "react-facebook", | ||
"version": "4.0.13", | ||
"version": "4.0.14", | ||
"description": "Facebook components like a Login button, Like, Share, Comments or Embedded Post", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -8,5 +8,6 @@ import PropTypes from 'prop-types'; | ||
scope: PropTypes.string.isRequired, | ||
fields: PropTypes.array.isRequired, | ||
fields: PropTypes.arrayOf(PropTypes.string), | ||
returnScopes: PropTypes.bool, | ||
rerequest: PropTypes.bool, | ||
reauthorize: PropTypes.bool, | ||
}; | ||
@@ -21,7 +22,9 @@ | ||
rerequest: false, | ||
reauthorize: false, | ||
}; | ||
async process(facebook) { | ||
const { scope, fields, returnScopes, rerequest } = this.props; | ||
const { scope, fields, returnScopes, rerequest, reauthorize } = this.props; | ||
const loginQpts = { scope }; | ||
const authType = []; | ||
@@ -33,5 +36,13 @@ if (returnScopes) { | ||
if (rerequest) { | ||
loginQpts.auth_type = 'rerequest'; | ||
authType.push('rerequest'); | ||
} | ||
if (reauthorize) { | ||
authType.push('reauthenticate'); | ||
} | ||
if (authType.length) { | ||
loginQpts.auth_type = authType.join(','); | ||
} | ||
const response = await facebook.login(loginQpts); | ||
@@ -38,0 +49,0 @@ if (response.status !== 'connected') { |
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
122021
3438