@turnkey/sdk-react 3.0.2 → 3.0.4
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 +25 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs +84 -102
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -1
- package/dist/components/auth/Apple.d.ts +4 -2
- package/dist/components/auth/Apple.d.ts.map +1 -1
- package/dist/components/auth/Apple.js +66 -41
- package/dist/components/auth/Apple.js.map +1 -1
- package/dist/components/auth/Apple.mjs +66 -41
- package/dist/components/auth/Apple.mjs.map +1 -1
- package/dist/components/auth/Auth.d.ts.map +1 -1
- package/dist/components/auth/Auth.js +29 -45
- package/dist/components/auth/Auth.js.map +1 -1
- package/dist/components/auth/Auth.mjs +123 -175
- package/dist/components/auth/Auth.mjs.map +1 -1
- package/dist/components/auth/Facebook.js.map +1 -1
- package/dist/components/auth/Facebook.mjs +3 -3
- package/dist/components/auth/Facebook.mjs.map +1 -1
- package/dist/components/auth/Google.js.map +1 -1
- package/dist/components/auth/Google.mjs +1 -1
- package/dist/components/auth/Google.mjs.map +1 -1
- package/dist/components/auth/OtpVerification.mjs +2 -2
- package/dist/components/auth/OtpVerification.mjs.map +1 -1
- package/dist/components/auth/PhoneInput.js.map +1 -1
- package/dist/components/auth/facebookUtils.mjs +2 -2
- package/dist/components/auth/facebookUtils.mjs.map +1 -1
- package/dist/components/auth/otp.js.map +1 -1
- package/dist/components/export/Export.mjs +4 -4
- package/dist/components/export/Export.mjs.map +1 -1
- package/dist/components/import/Import.mjs +3 -3
- package/dist/components/import/Import.mjs.map +1 -1
- package/dist/contexts/TurnkeyContext.mjs +3 -3
- package/dist/contexts/TurnkeyContext.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @turnkey/sdk-react
|
|
2
2
|
|
|
3
|
+
## 3.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9256e75: Fix apple login issue on mobile web browser
|
|
8
|
+
- bfc833f: Add getOrCreateSuborg server action
|
|
9
|
+
- Updated dependencies [3c44c4a]
|
|
10
|
+
- Updated dependencies [bfc833f]
|
|
11
|
+
- @turnkey/sdk-browser@1.14.0
|
|
12
|
+
- @turnkey/sdk-server@2.2.0
|
|
13
|
+
- @turnkey/crypto@2.3.1
|
|
14
|
+
- @turnkey/wallet-stamper@1.0.3
|
|
15
|
+
|
|
16
|
+
## 3.0.3
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 5f6de98: Fix phone number validation issue causing issues with non +1 country codes
|
|
21
|
+
- Updated dependencies [69d2571]
|
|
22
|
+
- Updated dependencies [57f9cb0]
|
|
23
|
+
- @turnkey/sdk-browser@1.13.0
|
|
24
|
+
- @turnkey/sdk-server@2.1.0
|
|
25
|
+
- @turnkey/crypto@2.3.1
|
|
26
|
+
- @turnkey/wallet-stamper@1.0.3
|
|
27
|
+
|
|
3
28
|
## 3.0.2
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -1,3 +1,50 @@
|
|
|
1
|
+
function _arrayLikeToArray(r, a) {
|
|
2
|
+
(null == a || a > r.length) && (a = r.length);
|
|
3
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4
|
+
return n;
|
|
5
|
+
}
|
|
6
|
+
function _arrayWithHoles(r) {
|
|
7
|
+
if (Array.isArray(r)) return r;
|
|
8
|
+
}
|
|
9
|
+
function _arrayWithoutHoles(r) {
|
|
10
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
11
|
+
}
|
|
12
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
13
|
+
try {
|
|
14
|
+
var i = n[a](c),
|
|
15
|
+
u = i.value;
|
|
16
|
+
} catch (n) {
|
|
17
|
+
return void e(n);
|
|
18
|
+
}
|
|
19
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
20
|
+
}
|
|
21
|
+
function _asyncToGenerator(n) {
|
|
22
|
+
return function () {
|
|
23
|
+
var t = this,
|
|
24
|
+
e = arguments;
|
|
25
|
+
return new Promise(function (r, o) {
|
|
26
|
+
var a = n.apply(t, e);
|
|
27
|
+
function _next(n) {
|
|
28
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
29
|
+
}
|
|
30
|
+
function _throw(n) {
|
|
31
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
32
|
+
}
|
|
33
|
+
_next(void 0);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function _defineProperty(e, r, t) {
|
|
38
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
39
|
+
value: t,
|
|
40
|
+
enumerable: !0,
|
|
41
|
+
configurable: !0,
|
|
42
|
+
writable: !0
|
|
43
|
+
}) : e[r] = t, e;
|
|
44
|
+
}
|
|
45
|
+
function _iterableToArray(r) {
|
|
46
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
47
|
+
}
|
|
1
48
|
function _iterableToArrayLimit(r, l) {
|
|
2
49
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
3
50
|
if (null != t) {
|
|
@@ -25,6 +72,12 @@ function _iterableToArrayLimit(r, l) {
|
|
|
25
72
|
return a;
|
|
26
73
|
}
|
|
27
74
|
}
|
|
75
|
+
function _nonIterableRest() {
|
|
76
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
77
|
+
}
|
|
78
|
+
function _nonIterableSpread() {
|
|
79
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
80
|
+
}
|
|
28
81
|
function ownKeys(e, r) {
|
|
29
82
|
var t = Object.keys(e);
|
|
30
83
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -46,6 +99,26 @@ function _objectSpread2(e) {
|
|
|
46
99
|
}
|
|
47
100
|
return e;
|
|
48
101
|
}
|
|
102
|
+
function _objectWithoutProperties(e, t) {
|
|
103
|
+
if (null == e) return {};
|
|
104
|
+
var o,
|
|
105
|
+
r,
|
|
106
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
107
|
+
if (Object.getOwnPropertySymbols) {
|
|
108
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
109
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
110
|
+
}
|
|
111
|
+
return i;
|
|
112
|
+
}
|
|
113
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
114
|
+
if (null == r) return {};
|
|
115
|
+
var t = {};
|
|
116
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
117
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
118
|
+
t[n] = r[n];
|
|
119
|
+
}
|
|
120
|
+
return t;
|
|
121
|
+
}
|
|
49
122
|
function _regeneratorRuntime() {
|
|
50
123
|
_regeneratorRuntime = function () {
|
|
51
124
|
return e;
|
|
@@ -347,6 +420,12 @@ function _regeneratorRuntime() {
|
|
|
347
420
|
}
|
|
348
421
|
}, e;
|
|
349
422
|
}
|
|
423
|
+
function _slicedToArray(r, e) {
|
|
424
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
425
|
+
}
|
|
426
|
+
function _toConsumableArray(r) {
|
|
427
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
428
|
+
}
|
|
350
429
|
function _toPrimitive(t, r) {
|
|
351
430
|
if ("object" != typeof t || !t) return t;
|
|
352
431
|
var e = t[Symbol.toPrimitive];
|
|
@@ -361,110 +440,13 @@ function _toPropertyKey(t) {
|
|
|
361
440
|
var i = _toPrimitive(t, "string");
|
|
362
441
|
return "symbol" == typeof i ? i : i + "";
|
|
363
442
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
var
|
|
368
|
-
|
|
369
|
-
reject(error);
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
if (info.done) {
|
|
373
|
-
resolve(value);
|
|
374
|
-
} else {
|
|
375
|
-
Promise.resolve(value).then(_next, _throw);
|
|
443
|
+
function _unsupportedIterableToArray(r, a) {
|
|
444
|
+
if (r) {
|
|
445
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
446
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
447
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
376
448
|
}
|
|
377
449
|
}
|
|
378
|
-
function _asyncToGenerator(fn) {
|
|
379
|
-
return function () {
|
|
380
|
-
var self = this,
|
|
381
|
-
args = arguments;
|
|
382
|
-
return new Promise(function (resolve, reject) {
|
|
383
|
-
var gen = fn.apply(self, args);
|
|
384
|
-
function _next(value) {
|
|
385
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
386
|
-
}
|
|
387
|
-
function _throw(err) {
|
|
388
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
389
|
-
}
|
|
390
|
-
_next(undefined);
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
function _defineProperty(obj, key, value) {
|
|
395
|
-
key = _toPropertyKey(key);
|
|
396
|
-
if (key in obj) {
|
|
397
|
-
Object.defineProperty(obj, key, {
|
|
398
|
-
value: value,
|
|
399
|
-
enumerable: true,
|
|
400
|
-
configurable: true,
|
|
401
|
-
writable: true
|
|
402
|
-
});
|
|
403
|
-
} else {
|
|
404
|
-
obj[key] = value;
|
|
405
|
-
}
|
|
406
|
-
return obj;
|
|
407
|
-
}
|
|
408
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
409
|
-
if (source == null) return {};
|
|
410
|
-
var target = {};
|
|
411
|
-
for (var key in source) {
|
|
412
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
413
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
414
|
-
target[key] = source[key];
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
return target;
|
|
418
|
-
}
|
|
419
|
-
function _objectWithoutProperties(source, excluded) {
|
|
420
|
-
if (source == null) return {};
|
|
421
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
422
|
-
var key, i;
|
|
423
|
-
if (Object.getOwnPropertySymbols) {
|
|
424
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
425
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
426
|
-
key = sourceSymbolKeys[i];
|
|
427
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
428
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
429
|
-
target[key] = source[key];
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
return target;
|
|
433
|
-
}
|
|
434
|
-
function _slicedToArray(arr, i) {
|
|
435
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
436
|
-
}
|
|
437
|
-
function _toConsumableArray(arr) {
|
|
438
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
439
|
-
}
|
|
440
|
-
function _arrayWithoutHoles(arr) {
|
|
441
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
442
|
-
}
|
|
443
|
-
function _arrayWithHoles(arr) {
|
|
444
|
-
if (Array.isArray(arr)) return arr;
|
|
445
|
-
}
|
|
446
|
-
function _iterableToArray(iter) {
|
|
447
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
448
|
-
}
|
|
449
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
450
|
-
if (!o) return;
|
|
451
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
452
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
453
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
454
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
455
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
456
|
-
}
|
|
457
|
-
function _arrayLikeToArray(arr, len) {
|
|
458
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
459
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
460
|
-
return arr2;
|
|
461
|
-
}
|
|
462
|
-
function _nonIterableSpread() {
|
|
463
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
464
|
-
}
|
|
465
|
-
function _nonIterableRest() {
|
|
466
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
467
|
-
}
|
|
468
450
|
|
|
469
451
|
export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _asyncToGenerator as asyncToGenerator, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _regeneratorRuntime as regeneratorRuntime, _slicedToArray as slicedToArray, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
|
|
470
452
|
//# sourceMappingURL=_rollupPluginBabelHelpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_rollupPluginBabelHelpers.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
interface AppleAuthButtonProps {
|
|
3
3
|
iframePublicKey: string;
|
|
4
4
|
clientId: string;
|
|
5
|
-
onSuccess: (response:
|
|
5
|
+
onSuccess: (response: {
|
|
6
|
+
idToken: string;
|
|
7
|
+
}) => void;
|
|
6
8
|
layout: "inline" | "stacked";
|
|
7
9
|
}
|
|
8
10
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apple.d.ts","sourceRoot":"","sources":["../../../src/components/auth/Apple.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Apple.d.ts","sourceRoot":"","sources":["../../../src/components/auth/Apple.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkBnD,UAAU,oBAAoB;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnD,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,CAAC,EAAE,GAAG,CAAC;KACf;CACF;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqHnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -4,32 +4,49 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var sha2 = require('@noble/hashes/sha2');
|
|
6
6
|
var utils = require('@noble/hashes/utils');
|
|
7
|
-
var Socials_module = require('./Socials.module.css.js');
|
|
8
7
|
var apple = require('../../assets/apple.svg.js');
|
|
8
|
+
var Socials_module = require('./Socials.module.css.js');
|
|
9
9
|
var constants = require('./constants.js');
|
|
10
10
|
|
|
11
|
+
function isMobileBrowser() {
|
|
12
|
+
return /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent);
|
|
13
|
+
}
|
|
11
14
|
const AppleAuthButton = ({
|
|
12
15
|
iframePublicKey,
|
|
13
|
-
onSuccess,
|
|
14
16
|
clientId,
|
|
17
|
+
onSuccess,
|
|
15
18
|
layout
|
|
16
19
|
}) => {
|
|
17
20
|
const [appleSDKLoaded, setAppleSDKLoaded] = React.useState(false);
|
|
18
21
|
const redirectURI = process.env.NEXT_PUBLIC_OAUTH_REDIRECT_URI;
|
|
19
22
|
React.useEffect(() => {
|
|
20
|
-
|
|
23
|
+
// 1. Load Apple's JS if not already present
|
|
24
|
+
if (!window.AppleID) {
|
|
21
25
|
const script = document.createElement("script");
|
|
22
26
|
script.src = constants.APPLE_AUTH_SCRIPT_URL;
|
|
23
27
|
script.onload = () => setAppleSDKLoaded(true);
|
|
24
|
-
script.onerror = () => console.error("Failed to load AppleID
|
|
28
|
+
script.onerror = () => console.error("Failed to load AppleID JS script");
|
|
25
29
|
document.body.appendChild(script);
|
|
26
|
-
};
|
|
27
|
-
if (!window.AppleID) {
|
|
28
|
-
loadAppleSDK();
|
|
29
30
|
} else {
|
|
30
31
|
setAppleSDKLoaded(true);
|
|
31
32
|
}
|
|
32
33
|
}, []);
|
|
34
|
+
// 2. Check on mount if we just came back from Apple with #id_token
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
// If there's a hash in the URL, parse it
|
|
37
|
+
if (window.location.hash) {
|
|
38
|
+
const hashParams = new URLSearchParams(window.location.hash.slice(1));
|
|
39
|
+
const idToken = hashParams.get("id_token");
|
|
40
|
+
if (idToken) {
|
|
41
|
+
// We have the token from Apple. Let the parent know.
|
|
42
|
+
onSuccess({
|
|
43
|
+
idToken
|
|
44
|
+
});
|
|
45
|
+
// Clear the hash so it doesn’t re-trigger on page refresh
|
|
46
|
+
window.history.replaceState({}, document.title, window.location.pathname);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, [onSuccess]);
|
|
33
50
|
const handleLogin = () => {
|
|
34
51
|
const nonce = utils.bytesToHex(sha2.sha256(iframePublicKey));
|
|
35
52
|
const appleAuthUrl = new URL(constants.APPLE_AUTH_URL);
|
|
@@ -38,49 +55,57 @@ const AppleAuthButton = ({
|
|
|
38
55
|
appleAuthUrl.searchParams.set("response_type", "code id_token");
|
|
39
56
|
appleAuthUrl.searchParams.set("response_mode", "fragment");
|
|
40
57
|
appleAuthUrl.searchParams.set("nonce", nonce);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
if (isMobileBrowser()) {
|
|
59
|
+
// Mobile: redirect the entire window
|
|
60
|
+
window.location.href = appleAuthUrl.toString();
|
|
61
|
+
} else {
|
|
62
|
+
// Desktop: open a popup
|
|
63
|
+
const width = constants.popupWidth;
|
|
64
|
+
const height = constants.popupHeight;
|
|
65
|
+
const left = window.screenX + (window.innerWidth - width) / 2;
|
|
66
|
+
const top = window.screenY + (window.innerHeight - height) / 2;
|
|
67
|
+
const authWindow = window.open(appleAuthUrl.toString(), "_blank", `width=${width},height=${height},top=${top},left=${left},scrollbars=yes,resizable=yes`);
|
|
68
|
+
if (!authWindow) {
|
|
69
|
+
console.error("Failed to open Apple login popup.");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// Poll for the redirect
|
|
73
|
+
const interval = setInterval(() => {
|
|
74
|
+
try {
|
|
75
|
+
if (authWindow.closed) {
|
|
76
|
+
clearInterval(interval);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const url = authWindow.location.href;
|
|
80
|
+
if (url.startsWith(window.location.origin)) {
|
|
81
|
+
const hashParams = new URLSearchParams(url.split("#")[1]);
|
|
82
|
+
const idToken = hashParams.get("id_token");
|
|
83
|
+
if (idToken) {
|
|
84
|
+
authWindow.close();
|
|
85
|
+
clearInterval(interval);
|
|
86
|
+
onSuccess({
|
|
87
|
+
idToken
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// Ignore cross-origin errors until the popup redirects to the same origin.
|
|
93
|
+
// These errors occur because the script attempts to access the URL of the popup window while it's on a different domain.
|
|
94
|
+
// Due to browser security policies (Same-Origin Policy), accessing properties like location.href on a window that is on a different domain will throw an exception.
|
|
95
|
+
// Once the popup redirects to the same origin as the parent window, these errors will no longer occur, and the script can safely access the popup's location to extract parameters.
|
|
96
|
+
if (authWindow?.closed) {
|
|
61
97
|
clearInterval(interval);
|
|
62
|
-
onSuccess({
|
|
63
|
-
idToken
|
|
64
|
-
});
|
|
65
98
|
}
|
|
66
99
|
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// These errors occur because the script attempts to access the URL of the popup window while it's on a different domain.
|
|
70
|
-
// Due to browser security policies (Same-Origin Policy), accessing properties like location.href on a window that is on a different domain will throw an exception.
|
|
71
|
-
// Once the popup redirects to the same origin as the parent window, these errors will no longer occur, and the script can safely access the popup's location to extract parameters.
|
|
72
|
-
}
|
|
73
|
-
if (authWindow?.closed) {
|
|
74
|
-
clearInterval(interval);
|
|
75
|
-
}
|
|
76
|
-
}, 500);
|
|
100
|
+
}, 500);
|
|
101
|
+
}
|
|
77
102
|
};
|
|
78
103
|
if (!appleSDKLoaded) {
|
|
79
104
|
return null;
|
|
80
105
|
}
|
|
81
106
|
return jsxRuntime.jsxs("div", {
|
|
82
|
-
onClick: handleLogin,
|
|
83
107
|
className: layout === "inline" ? Socials_module.iconButton : Socials_module.socialButton,
|
|
108
|
+
onClick: handleLogin,
|
|
84
109
|
children: [jsxRuntime.jsx("img", {
|
|
85
110
|
src: apple,
|
|
86
111
|
className: layout === "inline" ? Socials_module.iconLarge : Socials_module.iconSmall
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apple.js","sources":["../../../src/components/auth/Apple.tsx"],"sourcesContent":[null],"names":["AppleAuthButton","iframePublicKey","
|
|
1
|
+
{"version":3,"file":"Apple.js","sources":["../../../src/components/auth/Apple.tsx"],"sourcesContent":[null],"names":["isMobileBrowser","test","navigator","userAgent","AppleAuthButton","iframePublicKey","clientId","onSuccess","layout","appleSDKLoaded","setAppleSDKLoaded","useState","redirectURI","process","env","NEXT_PUBLIC_OAUTH_REDIRECT_URI","useEffect","window","AppleID","script","document","createElement","src","APPLE_AUTH_SCRIPT_URL","onload","onerror","console","error","body","appendChild","location","hash","hashParams","URLSearchParams","slice","idToken","get","history","replaceState","title","pathname","handleLogin","nonce","bytesToHex","sha256","appleAuthUrl","URL","APPLE_AUTH_URL","searchParams","set","href","toString","width","popupWidth","height","popupHeight","left","screenX","innerWidth","top","screenY","innerHeight","authWindow","open","interval","setInterval","closed","clearInterval","url","startsWith","origin","split","close","_jsxs","className","styles","iconButton","socialButton","onClick","children","_jsx","appleIcon","iconLarge","iconSmall"],"mappings":";;;;;;;;;;AAYA,SAASA,eAAeA,GAAA;AACtB,EAAA,OAAO,yDAAyD,CAACC,IAAI,CACnEC,SAAS,CAACC,SAAS,CACpB,CAAA;AACH,CAAA;AAeMC,MAAAA,eAAe,GAAmCA,CAAC;EACvDC,eAAe;EACfC,QAAQ;EACRC,SAAS;AACTC,EAAAA,MAAAA;AAAM,CACP,KAAI;EACH,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC,CAAA;AAC3D,EAAA,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,8BAA+B,CAAA;AAE/DC,EAAAA,eAAS,CAAC,MAAK;AACb;AACA,IAAA,IAAI,CAACC,MAAM,CAACC,OAAO,EAAE;AACnB,MAAA,MAAMC,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC,CAAA;MAC/CF,MAAM,CAACG,GAAG,GAAGC,+BAAqB,CAAA;AAClCJ,MAAAA,MAAM,CAACK,MAAM,GAAG,MAAMd,iBAAiB,CAAC,IAAI,CAAC,CAAA;MAC7CS,MAAM,CAACM,OAAO,GAAG,MAAMC,OAAO,CAACC,KAAK,CAAC,kCA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3,14 +3,17 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { sha256 } from '@noble/hashes/sha2';
|
|
5
5
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
6
|
-
import styles from './Socials.module.css.mjs';
|
|
7
6
|
import appleIcon from '../../assets/apple.svg.mjs';
|
|
7
|
+
import styles from './Socials.module.css.mjs';
|
|
8
8
|
import { APPLE_AUTH_SCRIPT_URL, APPLE_AUTH_URL, popupWidth, popupHeight } from './constants.mjs';
|
|
9
9
|
|
|
10
|
+
function isMobileBrowser() {
|
|
11
|
+
return /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent);
|
|
12
|
+
}
|
|
10
13
|
var AppleAuthButton = function AppleAuthButton(_ref) {
|
|
11
14
|
var iframePublicKey = _ref.iframePublicKey,
|
|
12
|
-
onSuccess = _ref.onSuccess,
|
|
13
15
|
clientId = _ref.clientId,
|
|
16
|
+
onSuccess = _ref.onSuccess,
|
|
14
17
|
layout = _ref.layout;
|
|
15
18
|
var _useState = useState(false),
|
|
16
19
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -18,23 +21,37 @@ var AppleAuthButton = function AppleAuthButton(_ref) {
|
|
|
18
21
|
setAppleSDKLoaded = _useState2[1];
|
|
19
22
|
var redirectURI = process.env.NEXT_PUBLIC_OAUTH_REDIRECT_URI;
|
|
20
23
|
useEffect(function () {
|
|
21
|
-
|
|
24
|
+
// 1. Load Apple's JS if not already present
|
|
25
|
+
if (!window.AppleID) {
|
|
22
26
|
var script = document.createElement("script");
|
|
23
27
|
script.src = APPLE_AUTH_SCRIPT_URL;
|
|
24
28
|
script.onload = function () {
|
|
25
29
|
return setAppleSDKLoaded(true);
|
|
26
30
|
};
|
|
27
31
|
script.onerror = function () {
|
|
28
|
-
return console.error("Failed to load AppleID
|
|
32
|
+
return console.error("Failed to load AppleID JS script");
|
|
29
33
|
};
|
|
30
34
|
document.body.appendChild(script);
|
|
31
|
-
};
|
|
32
|
-
if (!window.AppleID) {
|
|
33
|
-
loadAppleSDK();
|
|
34
35
|
} else {
|
|
35
36
|
setAppleSDKLoaded(true);
|
|
36
37
|
}
|
|
37
38
|
}, []);
|
|
39
|
+
// 2. Check on mount if we just came back from Apple with #id_token
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
// If there's a hash in the URL, parse it
|
|
42
|
+
if (window.location.hash) {
|
|
43
|
+
var hashParams = new URLSearchParams(window.location.hash.slice(1));
|
|
44
|
+
var idToken = hashParams.get("id_token");
|
|
45
|
+
if (idToken) {
|
|
46
|
+
// We have the token from Apple. Let the parent know.
|
|
47
|
+
onSuccess({
|
|
48
|
+
idToken: idToken
|
|
49
|
+
});
|
|
50
|
+
// Clear the hash so it doesn’t re-trigger on page refresh
|
|
51
|
+
window.history.replaceState({}, document.title, window.location.pathname);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, [onSuccess]);
|
|
38
55
|
var handleLogin = function handleLogin() {
|
|
39
56
|
var nonce = bytesToHex(sha256(iframePublicKey));
|
|
40
57
|
var appleAuthUrl = new URL(APPLE_AUTH_URL);
|
|
@@ -43,49 +60,57 @@ var AppleAuthButton = function AppleAuthButton(_ref) {
|
|
|
43
60
|
appleAuthUrl.searchParams.set("response_type", "code id_token");
|
|
44
61
|
appleAuthUrl.searchParams.set("response_mode", "fragment");
|
|
45
62
|
appleAuthUrl.searchParams.set("nonce", nonce);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
if (isMobileBrowser()) {
|
|
64
|
+
// Mobile: redirect the entire window
|
|
65
|
+
window.location.href = appleAuthUrl.toString();
|
|
66
|
+
} else {
|
|
67
|
+
// Desktop: open a popup
|
|
68
|
+
var width = popupWidth;
|
|
69
|
+
var height = popupHeight;
|
|
70
|
+
var left = window.screenX + (window.innerWidth - width) / 2;
|
|
71
|
+
var top = window.screenY + (window.innerHeight - height) / 2;
|
|
72
|
+
var authWindow = window.open(appleAuthUrl.toString(), "_blank", "width=".concat(width, ",height=").concat(height, ",top=").concat(top, ",left=").concat(left, ",scrollbars=yes,resizable=yes"));
|
|
73
|
+
if (!authWindow) {
|
|
74
|
+
console.error("Failed to open Apple login popup.");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// Poll for the redirect
|
|
78
|
+
var interval = setInterval(function () {
|
|
79
|
+
try {
|
|
80
|
+
if (authWindow.closed) {
|
|
81
|
+
clearInterval(interval);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
var url = authWindow.location.href;
|
|
85
|
+
if (url.startsWith(window.location.origin)) {
|
|
86
|
+
var hashParams = new URLSearchParams(url.split("#")[1]);
|
|
87
|
+
var idToken = hashParams.get("id_token");
|
|
88
|
+
if (idToken) {
|
|
89
|
+
authWindow.close();
|
|
90
|
+
clearInterval(interval);
|
|
91
|
+
onSuccess({
|
|
92
|
+
idToken: idToken
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
} catch (error) {
|
|
97
|
+
// Ignore cross-origin errors until the popup redirects to the same origin.
|
|
98
|
+
// These errors occur because the script attempts to access the URL of the popup window while it's on a different domain.
|
|
99
|
+
// Due to browser security policies (Same-Origin Policy), accessing properties like location.href on a window that is on a different domain will throw an exception.
|
|
100
|
+
// Once the popup redirects to the same origin as the parent window, these errors will no longer occur, and the script can safely access the popup's location to extract parameters.
|
|
101
|
+
if (authWindow !== null && authWindow !== void 0 && authWindow.closed) {
|
|
66
102
|
clearInterval(interval);
|
|
67
|
-
onSuccess({
|
|
68
|
-
idToken: idToken
|
|
69
|
-
});
|
|
70
103
|
}
|
|
71
104
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// These errors occur because the script attempts to access the URL of the popup window while it's on a different domain.
|
|
75
|
-
// Due to browser security policies (Same-Origin Policy), accessing properties like location.href on a window that is on a different domain will throw an exception.
|
|
76
|
-
// Once the popup redirects to the same origin as the parent window, these errors will no longer occur, and the script can safely access the popup's location to extract parameters.
|
|
77
|
-
}
|
|
78
|
-
if (authWindow !== null && authWindow !== void 0 && authWindow.closed) {
|
|
79
|
-
clearInterval(interval);
|
|
80
|
-
}
|
|
81
|
-
}, 500);
|
|
105
|
+
}, 500);
|
|
106
|
+
}
|
|
82
107
|
};
|
|
83
108
|
if (!appleSDKLoaded) {
|
|
84
109
|
return null;
|
|
85
110
|
}
|
|
86
111
|
return jsxs("div", {
|
|
87
|
-
onClick: handleLogin,
|
|
88
112
|
className: layout === "inline" ? styles.iconButton : styles.socialButton,
|
|
113
|
+
onClick: handleLogin,
|
|
89
114
|
children: [jsx("img", {
|
|
90
115
|
src: appleIcon,
|
|
91
116
|
className: layout === "inline" ? styles.iconLarge : styles.iconSmall
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Apple.mjs","sources":["../../../src/components/auth/Apple.tsx"],"sourcesContent":[null],"names":["AppleAuthButton","_ref","iframePublicKey","
|
|
1
|
+
{"version":3,"file":"Apple.mjs","sources":["../../../src/components/auth/Apple.tsx"],"sourcesContent":[null],"names":["isMobileBrowser","test","navigator","userAgent","AppleAuthButton","_ref","iframePublicKey","clientId","onSuccess","layout","_useState","useState","_useState2","_slicedToArray","appleSDKLoaded","setAppleSDKLoaded","redirectURI","process","env","NEXT_PUBLIC_OAUTH_REDIRECT_URI","useEffect","window","AppleID","script","document","createElement","src","APPLE_AUTH_SCRIPT_URL","onload","onerror","console","error","body","appendChild","location","hash","hashParams","URLSearchParams","slice","idToken","get","history","replaceState","title","pathname","handleLogin","nonce","bytesToHex","sha256","appleAuthUrl","URL","APPLE_AUTH_URL","searchParams","set","href","toString","width","popupWidth","height","popupHeight","left","screenX","innerWidth","top","screenY","innerHeight","authWindow","open","concat","interval","setInterval","closed","clearInterval","url","startsWith","origin","split","close","_jsxs","className","styles","iconButton","socialButton","onClick","children","_jsx","appleIcon","iconLarge","iconSmall"],"mappings":";;;;;;;;;AAYA,SAASA,eAAeA,GAAA;AACtB,EAAA,OAAO,yDAAyD,CAACC,IAAI,CACnEC,SAAS,CAACC,SAAS,CACpB,CAAA;AACH,CAAA;AAeA,IAAMC,eAAe,GAAmC,SAAlDA,eAAeA,CAAAC,IAAA,EAKhB;AAAA,EAAA,IAJHC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,MAAM,GAAAJ,IAAA,CAANI,MAAM,CAAA;AAEN,EAAA,IAAAC,SAAA,GAA4CC,QAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAApDI,IAAAA,cAAc,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,iBAAiB,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AACxC,EAAA,IAAMI,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,8BAA+B,CAAA;AAE/DC,EAAAA,SAAS,CAAC,YAAK;AACb;AACA,IAAA,IAAI,CAACC,MAAM,CAACC,OAAO,EAAE;AACnB,MAAA,IAAMC,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC,CAAA;MAC/CF,MAAM,CAACG,GAAG,GAAGC,qBAAqB,CAAA;MAClCJ,MAAM,CAACK,MAAM,GAAG,YAAA;QAAA,OAAMb,iBAAiB,CAAC,IAAI,CAAC,CAAA;AAAA,OAAA,CAAA;MAC7CQ,MAAM,CAACM,OAAO,GAAG,YAAA;AAAA,QAAA,OAAMC,OAAO,CAACC,KAAK,CAAC,k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