@widergy/react-social-auth 3.2.0 → 3.2.2
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.2.2](https://github.com/widergy/react-social-auth/compare/v3.2.1...v3.2.2) (2025-02-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* [OCH-67] azure logout ([#25](https://github.com/widergy/react-social-auth/issues/25)) ([b7d6114](https://github.com/widergy/react-social-auth/commit/b7d611457c8dcc7c241d4d1673ac609a81282b30))
|
|
7
|
+
|
|
8
|
+
## [3.2.1](https://github.com/widergy/react-social-auth/compare/v3.2.0...v3.2.1) (2025-01-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fixes google colors ([#24](https://github.com/widergy/react-social-auth/issues/24)) ([99161a7](https://github.com/widergy/react-social-auth/commit/99161a76a50a5b61f758d1e75c25f58fa3ee9242))
|
|
14
|
+
|
|
1
15
|
# [3.2.0](https://github.com/widergy/react-social-auth/compare/v3.1.1...v3.2.0) (2024-10-21)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -12,14 +12,14 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
const ActiveDirectory = _ref => {
|
|
14
14
|
let {
|
|
15
|
-
Component,
|
|
16
15
|
authority,
|
|
17
|
-
onSuccess,
|
|
18
|
-
onFailure,
|
|
19
16
|
clientId,
|
|
17
|
+
Component,
|
|
18
|
+
onFailure,
|
|
19
|
+
onSuccess,
|
|
20
|
+
publicClientApplicationInstanced,
|
|
20
21
|
redirectUri,
|
|
21
|
-
scopes
|
|
22
|
-
publicClientApplicationInstanced
|
|
22
|
+
scopes
|
|
23
23
|
} = _ref;
|
|
24
24
|
const [publicClientApplication] = (0, _react.useState)(publicClientApplicationInstanced ?? new _msalBrowser.PublicClientApplication({
|
|
25
25
|
auth: {
|
|
@@ -71,13 +71,14 @@ const ActiveDirectory = _ref => {
|
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
ActiveDirectory.propTypes = {
|
|
74
|
-
Component: _propTypes.node,
|
|
75
74
|
authority: _propTypes.string,
|
|
76
|
-
onSuccess: _propTypes.func,
|
|
77
|
-
onFailure: _propTypes.func,
|
|
78
75
|
clientId: _propTypes.string,
|
|
76
|
+
Component: _propTypes.elementType,
|
|
77
|
+
homeAccountId: _propTypes.string,
|
|
78
|
+
onFailure: _propTypes.func,
|
|
79
|
+
onSuccess: _propTypes.func,
|
|
80
|
+
publicClientApplicationInstanced: (0, _propTypes.instanceOf)(_msalBrowser.PublicClientApplication),
|
|
79
81
|
redirectUri: _propTypes.string,
|
|
80
|
-
scopes: (0, _propTypes.arrayOf)(_propTypes.string)
|
|
81
|
-
publicClientApplicationInstanced: (0, _propTypes.instanceOf)(_msalBrowser.PublicClientApplication)
|
|
82
|
+
scopes: (0, _propTypes.arrayOf)(_propTypes.string)
|
|
82
83
|
};
|
|
83
84
|
var _default = exports.default = ActiveDirectory;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.normalizeError = void 0;
|
|
6
|
+
exports.normalizeError = exports.handleLogoutPopup = void 0;
|
|
7
7
|
const normalizeError = error => {
|
|
8
8
|
let normalizedError = {};
|
|
9
9
|
if (typeof error === 'string') {
|
|
@@ -22,4 +22,18 @@ const normalizeError = error => {
|
|
|
22
22
|
}
|
|
23
23
|
return normalizedError;
|
|
24
24
|
};
|
|
25
|
-
exports.normalizeError = normalizeError;
|
|
25
|
+
exports.normalizeError = normalizeError;
|
|
26
|
+
const handleLogoutPopup = async (publicClientApplication, homeAccountId, postLogoutRedirectUri) => {
|
|
27
|
+
try {
|
|
28
|
+
const account = publicClientApplication.getAccountByHomeId(homeAccountId);
|
|
29
|
+
if (!account) throw new Error('login_required');
|
|
30
|
+
const logoutRequest = {
|
|
31
|
+
account,
|
|
32
|
+
postLogoutRedirectUri
|
|
33
|
+
};
|
|
34
|
+
return await publicClientApplication.logoutPopup(logoutRequest);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (onFailure) onFailure(normalizeError(err));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.handleLogoutPopup = handleLogoutPopup;
|
|
@@ -32,6 +32,9 @@ const GoogleButton = _ref => {
|
|
|
32
32
|
},
|
|
33
33
|
dataTestId: dataTestId,
|
|
34
34
|
email: email,
|
|
35
|
+
emailLabelProps: {
|
|
36
|
+
colorTheme: 'gray'
|
|
37
|
+
},
|
|
35
38
|
Icon: _ref2 => {
|
|
36
39
|
let {
|
|
37
40
|
className
|
|
@@ -46,7 +49,8 @@ const GoogleButton = _ref => {
|
|
|
46
49
|
mainLabelProps: {
|
|
47
50
|
...(size === _buttonSizes.LARGE ? {
|
|
48
51
|
colorTheme: 'dark',
|
|
49
|
-
shade: '
|
|
52
|
+
shade: '05',
|
|
53
|
+
weight: 'medium'
|
|
50
54
|
} : {})
|
|
51
55
|
},
|
|
52
56
|
onClick: login,
|
package/dist/index.js
CHANGED
|
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "Twitter", {
|
|
|
51
51
|
return _Twitter.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "handleLogoutPopup", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _utils.handleLogoutPopup;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
var _ActiveDirectory = _interopRequireDefault(require("./components/ActiveDirectory"));
|
|
55
61
|
var _Apple = _interopRequireDefault(require("./components/Apple"));
|
|
56
62
|
var _Button = _interopRequireDefault(require("./components/Button"));
|
|
@@ -59,4 +65,5 @@ var _Facebook = _interopRequireDefault(require("./components/Facebook"));
|
|
|
59
65
|
var _Google = _interopRequireDefault(require("./components/Google"));
|
|
60
66
|
var _Microsoft = _interopRequireDefault(require("./components/Microsoft"));
|
|
61
67
|
var _Twitter = _interopRequireDefault(require("./components/Twitter"));
|
|
68
|
+
var _utils = require("./components/ActiveDirectory/utils");
|
|
62
69
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|