@turnkey/sdk-react 3.1.0 → 4.0.0

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/components/auth/Apple.d.ts.map +1 -1
  3. package/dist/components/auth/Apple.js +21 -8
  4. package/dist/components/auth/Apple.js.map +1 -1
  5. package/dist/components/auth/Apple.mjs +27 -11
  6. package/dist/components/auth/Apple.mjs.map +1 -1
  7. package/dist/components/auth/Auth.d.ts +7 -1
  8. package/dist/components/auth/Auth.d.ts.map +1 -1
  9. package/dist/components/auth/Auth.js +72 -77
  10. package/dist/components/auth/Auth.js.map +1 -1
  11. package/dist/components/auth/Auth.mjs +198 -238
  12. package/dist/components/auth/Auth.mjs.map +1 -1
  13. package/dist/components/auth/Facebook.d.ts.map +1 -1
  14. package/dist/components/auth/Facebook.js +19 -8
  15. package/dist/components/auth/Facebook.js.map +1 -1
  16. package/dist/components/auth/Facebook.mjs +35 -21
  17. package/dist/components/auth/Facebook.mjs.map +1 -1
  18. package/dist/components/auth/Google.d.ts.map +1 -1
  19. package/dist/components/auth/Google.js +20 -9
  20. package/dist/components/auth/Google.js.map +1 -1
  21. package/dist/components/auth/Google.mjs +28 -14
  22. package/dist/components/auth/Google.mjs.map +1 -1
  23. package/dist/components/auth/OtpVerification.d.ts +1 -2
  24. package/dist/components/auth/OtpVerification.d.ts.map +1 -1
  25. package/dist/components/auth/OtpVerification.js +11 -5
  26. package/dist/components/auth/OtpVerification.js.map +1 -1
  27. package/dist/components/auth/OtpVerification.mjs +24 -17
  28. package/dist/components/auth/OtpVerification.mjs.map +1 -1
  29. package/dist/contexts/TurnkeyContext.d.ts.map +1 -1
  30. package/dist/contexts/TurnkeyContext.js +24 -16
  31. package/dist/contexts/TurnkeyContext.js.map +1 -1
  32. package/dist/contexts/TurnkeyContext.mjs +30 -33
  33. package/dist/contexts/TurnkeyContext.mjs.map +1 -1
  34. package/dist/hooks/use-session.d.ts.map +1 -1
  35. package/dist/hooks/use-session.js +24 -12
  36. package/dist/hooks/use-session.js.map +1 -1
  37. package/dist/hooks/use-session.mjs +28 -14
  38. package/dist/hooks/use-session.mjs.map +1 -1
  39. package/dist/index.js +1 -1
  40. package/package.json +4 -4
@@ -19,6 +19,11 @@ import { OtpType, FilterType, authErrors } from './constants.mjs';
19
19
  import { server } from '@turnkey/sdk-server';
20
20
  import parsePhoneNumberFromString from 'libphonenumber-js';
21
21
 
22
+ var SessionType;
23
+ (function (SessionType) {
24
+ SessionType["READ_ONLY"] = "SESSION_TYPE_READ_ONLY";
25
+ SessionType["READ_WRITE"] = "SESSION_TYPE_READ_WRITE";
26
+ })(SessionType || (SessionType = {}));
22
27
  var passkeyIcon = jsxs("svg", {
23
28
  xmlns: "http://www.w3.org/2000/svg",
24
29
  width: "43",
@@ -26,14 +31,14 @@ var passkeyIcon = jsxs("svg", {
26
31
  fill: "none",
27
32
  children: [jsx("path", {
28
33
  fill: "var(--icon-color)",
29
- "fill-rule": "evenodd",
34
+ fillRule: "evenodd",
30
35
  d: "M27.52 37.06a6.8 6.8 0 0 0-2.02-.31H12a6.75 6.75 0 0 0-6.75 6.75V48H.75v-4.5A11.25 11.25 0 0 1 12 32.25h13.5c.68 0 1.355.062 2.016.182zm4.698-23.74a13.5 13.5 0 1 0-8.503 13.484c-.057-.178-.131-.425-.167-.566a13 13 0 0 1-.229-1.134 12 12 0 0 1-.054-.448q-.02-.202-.013-1.064c.007-.82.01-.877.055-1.186.018-.121.046-.29.072-.438a9 9 0 1 1 4.315-6.714 13.83 13.83 0 0 1 .87-.564 14 14 0 0 1 1.08-.556c.102-.045.299-.128.44-.184.14-.056.384-.146.544-.202.16-.055.436-.141.615-.194.18-.05.467-.125.641-.165.092-.02.214-.046.334-.07",
31
- "clip-rule": "evenodd"
36
+ clipRule: "evenodd"
32
37
  }), jsx("path", {
33
38
  fill: "var(--icon-color)",
34
- "fill-rule": "evenodd",
39
+ fillRule: "evenodd",
35
40
  d: "M33.844 16.554a9.563 9.563 0 0 0-.975.134c-.125.022-.355.075-.51.114s-.418.12-.589.177a11 11 0 0 0-.553.21 12 12 0 0 0-.519.244 8.29 8.29 0 0 0-.961.573c-.114.08-.313.23-.445.334-.13.104-.358.31-.507.454a10 10 0 0 0-.466.495c-.107.127-.269.334-.362.46-.091.128-.232.34-.313.474-.079.133-.195.34-.256.46-.062.122-.15.308-.196.413a10 10 0 0 0-.152.387c-.04.107-.1.304-.14.44a9 9 0 0 0-.119.51c-.028.145-.065.374-.082.51a6 6 0 0 0-.032.773c-.002.327.007.598.021.712a8.924 8.924 0 0 0 .163.905c.03.116.09.322.134.457.046.136.125.35.178.475a8 8 0 0 0 .725 1.329 9.15 9.15 0 0 0 .622.772c.111.121.294.306.408.41.114.101.295.256.4.342.108.085.273.211.37.28.097.068.244.165.325.218l.299.179c.082.047.251.137.374.2.125.062.232.127.24.146.013.025.018 2.403.018 7.032 0 5.905.004 7.018.025 7.125.014.07.047.18.075.24.029.064.08.156.113.203.032.05.522.654 1.086 1.345.564.693 1.07 1.31 1.123 1.371.054.063.14.151.195.195.054.042.162.111.239.151s.204.092.281.115c.121.035.181.04.413.04.206 0 .3-.007.387-.03a2 2 0 0 0 .237-.09 1.8 1.8 0 0 0 .388-.25c.029-.029.547-.657 1.153-1.397a97 97 0 0 0 1.12-1.383.4.4 0 0 0 .019-.137c0-.053-.016-.178-.035-.276a5 5 0 0 0-.273-.876 24 24 0 0 0-.298-.73 32 32 0 0 0-.626-1.365.8.8 0 0 1-.069-.172q.001-.033.041-.043c.021-.003.134-.016.25-.026s.295-.032.395-.046c.102-.016.248-.044.325-.065a.9.9 0 0 0 .237-.102.8.8 0 0 0 .15-.133c.028-.037.073-.116.1-.174.026-.058.054-.16.065-.229a1.895 1.895 0 0 0-.042-.589 2 2 0 0 0-.074-.193c-.023-.053-.355-.542-.736-1.085-.38-.543-.693-1.005-.693-1.025 0-.028.037-.046.234-.105.128-.04.339-.113.469-.162.132-.047.293-.116.36-.15a1 1 0 0 0 .204-.144.8.8 0 0 0 .144-.212c.034-.072.072-.18.085-.238s.024-.2.024-.316c0-.123-.009-.25-.024-.308a1.4 1.4 0 0 0-.072-.202c-.032-.07-.275-.39-.737-.975-.378-.479-.687-.883-.687-.9s.018-.043.04-.055.197-.11.39-.215c.194-.103.431-.237.528-.295.096-.058.22-.15.274-.204a1.1 1.1 0 0 0 .257-.459c.026-.1.031-.247.04-1.283.005-.642.016-1.178.023-1.19s.105-.069.22-.125c.112-.058.284-.15.38-.204a10 10 0 0 0 .985-.668 6.762 6.762 0 0 0 .826-.767c.107-.117.267-.305.358-.418a8 8 0 0 0 .605-.891 8.9 8.9 0 0 0 .373-.756c.045-.105.12-.308.17-.448a8 8 0 0 0 .156-.536c.037-.155.088-.408.113-.563.023-.155.05-.381.061-.505a8 8 0 0 0-.007-1.139 8 8 0 0 0-.07-.527 8 8 0 0 0-.097-.466c-.028-.116-.08-.3-.116-.413a7 7 0 0 0-.83-1.714 10 10 0 0 0-.256-.37 9 9 0 0 0-.23-.29 9 9 0 0 0-.81-.82 9 9 0 0 0-.395-.32 9 9 0 0 0-.835-.556 13 13 0 0 0-.417-.221 11 11 0 0 0-.483-.223 8 8 0 0 0-.98-.343 11 11 0 0 0-.422-.108c-.106-.022-.288-.06-.404-.079a10 10 0 0 0-.51-.073 8 8 0 0 0-.852-.043c-.304-.001-.644.002-.756.011m.207 3.334-.058.006a4.6 4.6 0 0 0-1.283.341 4 4 0 0 0-.334.159 4.354 4.354 0 0 0-.668.452 5.5 5.5 0 0 0-.669.69 5 5 0 0 0-.207.308 4 4 0 0 0-.18.325c-.04.088-.101.234-.135.325a3.856 3.856 0 0 0-.177.66c-.016.087-.034.24-.04.342-.01.159-.008.19.017.215.028.03.25.031 4.175.031 3.663 0 4.15-.003 4.174-.026q.029-.027.028-.12a3 3 0 0 0-.072-.574 3.9 3.9 0 0 0-.297-.87 4 4 0 0 0-.21-.379 6 6 0 0 0-.23-.316 6 6 0 0 0-.346-.37 5 5 0 0 0-.365-.326 7 7 0 0 0-.246-.178 5 5 0 0 0-.264-.16 4.6 4.6 0 0 0-1.585-.52 5.681 5.681 0 0 0-.84-.035z",
36
- "clip-rule": "evenodd"
41
+ clipRule: "evenodd"
37
42
  })]
38
43
  });
39
44
  var passkeyIconError = jsxs("svg", {
@@ -43,14 +48,14 @@ var passkeyIconError = jsxs("svg", {
43
48
  fill: "none",
44
49
  children: [jsx("path", {
45
50
  fill: "var(--error-color)",
46
- "fill-rule": "evenodd",
51
+ fillRule: "evenodd",
47
52
  d: "M27.52 37.06a6.8 6.8 0 0 0-2.02-.31H12a6.75 6.75 0 0 0-6.75 6.75V48H.75v-4.5A11.25 11.25 0 0 1 12 32.25h13.5c.68 0 1.355.062 2.016.182zm4.698-23.74a13.5 13.5 0 1 0-8.503 13.484c-.057-.178-.131-.425-.167-.566a13 13 0 0 1-.229-1.134 12 12 0 0 1-.054-.448q-.02-.202-.013-1.064c.007-.82.01-.877.055-1.186.018-.121.046-.29.072-.438a9 9 0 1 1 4.315-6.714 13.83 13.83 0 0 1 .87-.564 14 14 0 0 1 1.08-.556c.102-.045.299-.128.44-.184.14-.056.384-.146.544-.202.16-.055.436-.141.615-.194.18-.05.467-.125.641-.165.092-.02.214-.046.334-.07",
48
- "clip-rule": "evenodd"
53
+ clipRule: "evenodd"
49
54
  }), jsx("path", {
50
55
  fill: "var(--error-color)",
51
- "fill-rule": "evenodd",
56
+ fillRule: "evenodd",
52
57
  d: "M33.844 16.554a9.563 9.563 0 0 0-.975.134c-.125.022-.355.075-.51.114s-.418.12-.589.177a11 11 0 0 0-.553.21 12 12 0 0 0-.519.244 8.29 8.29 0 0 0-.961.573c-.114.08-.313.23-.445.334-.13.104-.358.31-.507.454a10 10 0 0 0-.466.495c-.107.127-.269.334-.362.46-.091.128-.232.34-.313.474-.079.133-.195.34-.256.46-.062.122-.15.308-.196.413a10 10 0 0 0-.152.387c-.04.107-.1.304-.14.44a9 9 0 0 0-.119.51c-.028.145-.065.374-.082.51a6 6 0 0 0-.032.773c-.002.327.007.598.021.712a8.924 8.924 0 0 0 .163.905c.03.116.09.322.134.457.046.136.125.35.178.475a8 8 0 0 0 .725 1.329 9.15 9.15 0 0 0 .622.772c.111.121.294.306.408.41.114.101.295.256.4.342.108.085.273.211.37.28.097.068.244.165.325.218l.299.179c.082.047.251.137.374.2.125.062.232.127.24.146.013.025.018 2.403.018 7.032 0 5.905.004 7.018.025 7.125.014.07.047.18.075.24.029.064.08.156.113.203.032.05.522.654 1.086 1.345.564.693 1.07 1.31 1.123 1.371.054.063.14.151.195.195.054.042.162.111.239.151s.204.092.281.115c.121.035.181.04.413.04.206 0 .3-.007.387-.03a2 2 0 0 0 .237-.09 1.8 1.8 0 0 0 .388-.25c.029-.029.547-.657 1.153-1.397a97 97 0 0 0 1.12-1.383.4.4 0 0 0 .019-.137c0-.053-.016-.178-.035-.276a5 5 0 0 0-.273-.876 24 24 0 0 0-.298-.73 32 32 0 0 0-.626-1.365.8.8 0 0 1-.069-.172q.001-.033.041-.043c.021-.003.134-.016.25-.026s.295-.032.395-.046c.102-.016.248-.044.325-.065a.9.9 0 0 0 .237-.102.8.8 0 0 0 .15-.133c.028-.037.073-.116.1-.174.026-.058.054-.16.065-.229a1.895 1.895 0 0 0-.042-.589 2 2 0 0 0-.074-.193c-.023-.053-.355-.542-.736-1.085-.38-.543-.693-1.005-.693-1.025 0-.028.037-.046.234-.105.128-.04.339-.113.469-.162.132-.047.293-.116.36-.15a1 1 0 0 0 .204-.144.8.8 0 0 0 .144-.212c.034-.072.072-.18.085-.238s.024-.2.024-.316c0-.123-.009-.25-.024-.308a1.4 1.4 0 0 0-.072-.202c-.032-.07-.275-.39-.737-.975-.378-.479-.687-.883-.687-.9s.018-.043.04-.055.197-.11.39-.215c.194-.103.431-.237.528-.295.096-.058.22-.15.274-.204a1.1 1.1 0 0 0 .257-.459c.026-.1.031-.247.04-1.283.005-.642.016-1.178.023-1.19s.105-.069.22-.125c.112-.058.284-.15.38-.204a10 10 0 0 0 .985-.668 6.762 6.762 0 0 0 .826-.767c.107-.117.267-.305.358-.418a8 8 0 0 0 .605-.891 8.9 8.9 0 0 0 .373-.756c.045-.105.12-.308.17-.448a8 8 0 0 0 .156-.536c.037-.155.088-.408.113-.563.023-.155.05-.381.061-.505a8 8 0 0 0-.007-1.139 8 8 0 0 0-.07-.527 8 8 0 0 0-.097-.466c-.028-.116-.08-.3-.116-.413a7 7 0 0 0-.83-1.714 10 10 0 0 0-.256-.37 9 9 0 0 0-.23-.29 9 9 0 0 0-.81-.82 9 9 0 0 0-.395-.32 9 9 0 0 0-.835-.556 13 13 0 0 0-.417-.221 11 11 0 0 0-.483-.223 8 8 0 0 0-.98-.343 11 11 0 0 0-.422-.108c-.106-.022-.288-.06-.404-.079a10 10 0 0 0-.51-.073 8 8 0 0 0-.852-.043c-.304-.001-.644.002-.756.011m.207 3.334-.058.006a4.6 4.6 0 0 0-1.283.341 4 4 0 0 0-.334.159 4.354 4.354 0 0 0-.668.452 5.5 5.5 0 0 0-.669.69 5 5 0 0 0-.207.308 4 4 0 0 0-.18.325c-.04.088-.101.234-.135.325a3.856 3.856 0 0 0-.177.66c-.016.087-.034.24-.04.342-.01.159-.008.19.017.215.028.03.25.031 4.175.031 3.663 0 4.15-.003 4.174-.026q.029-.027.028-.12a3 3 0 0 0-.072-.574 3.9 3.9 0 0 0-.297-.87 4 4 0 0 0-.21-.379 6 6 0 0 0-.23-.316 6 6 0 0 0-.346-.37 5 5 0 0 0-.365-.326 7 7 0 0 0-.246-.178 5 5 0 0 0-.264-.16 4.6 4.6 0 0 0-1.585-.52 5.681 5.681 0 0 0-.84-.035z",
53
- "clip-rule": "evenodd"
58
+ clipRule: "evenodd"
54
59
  })]
55
60
  });
56
61
  var Auth = function Auth(_ref) {
@@ -58,13 +63,14 @@ var Auth = function Auth(_ref) {
58
63
  onError = _ref.onError,
59
64
  authConfig = _ref.authConfig,
60
65
  configOrder = _ref.configOrder,
66
+ emailCustomization = _ref.emailCustomization,
67
+ sendFromEmailAddress = _ref.sendFromEmailAddress,
61
68
  customSmsMessage = _ref.customSmsMessage,
62
69
  customAccounts = _ref.customAccounts;
63
70
  var _useTurnkey = useTurnkey(),
64
- passkeyClient = _useTurnkey.passkeyClient,
65
71
  authIframeClient = _useTurnkey.authIframeClient,
66
- walletClient = _useTurnkey.walletClient,
67
- turnkey = _useTurnkey.turnkey;
72
+ passkeyClient = _useTurnkey.passkeyClient,
73
+ walletClient = _useTurnkey.walletClient;
68
74
  var _useState = useState(""),
69
75
  _useState2 = _slicedToArray(_useState, 2),
70
76
  email = _useState2[0],
@@ -81,38 +87,38 @@ var Auth = function Auth(_ref) {
81
87
  _useState8 = _slicedToArray(_useState7, 2),
82
88
  step = _useState8[0],
83
89
  setStep = _useState8[1];
84
- var _useState9 = useState(""),
90
+ var _useState9 = useState(),
85
91
  _useState10 = _slicedToArray(_useState9, 2),
86
- oauthLoading = _useState10[0],
87
- setOauthLoading = _useState10[1];
92
+ loading = _useState10[0],
93
+ setLoading = _useState10[1];
88
94
  var _useState11 = useState(""),
89
95
  _useState12 = _slicedToArray(_useState11, 2),
90
- suborgId = _useState12[0],
91
- setSuborgId = _useState12[1];
92
- var _useState13 = useState(false),
96
+ oauthLoading = _useState12[0],
97
+ setOauthLoading = _useState12[1];
98
+ var _useState13 = useState(""),
93
99
  _useState14 = _slicedToArray(_useState13, 2),
94
- passkeySignupScreen = _useState14[0],
95
- setPasskeySignupScreen = _useState14[1];
100
+ suborgId = _useState14[0],
101
+ setSuborgId = _useState14[1];
96
102
  var _useState15 = useState(false),
97
103
  _useState16 = _slicedToArray(_useState15, 2),
98
- passkeyCreationScreen = _useState16[0],
99
- setPasskeyCreationScreen = _useState16[1];
100
- var _useState17 = useState(""),
104
+ passkeySignupScreen = _useState16[0],
105
+ setPasskeySignupScreen = _useState16[1];
106
+ var _useState17 = useState(false),
101
107
  _useState18 = _slicedToArray(_useState17, 2),
102
- passkeySignupError = _useState18[0],
103
- setPasskeySignupError = _useState18[1];
104
- var _useState19 = useState(true),
108
+ passkeyCreationScreen = _useState18[0],
109
+ setPasskeyCreationScreen = _useState18[1];
110
+ var _useState19 = useState(""),
105
111
  _useState20 = _slicedToArray(_useState19, 2),
106
- loading = _useState20[0],
107
- setLoading = _useState20[1];
112
+ passkeySignupError = _useState20[0],
113
+ setPasskeySignupError = _useState20[1];
108
114
  var _useState21 = useState(false),
109
115
  _useState22 = _slicedToArray(_useState21, 2),
110
- passkeyCreated = _useState22[0],
111
- setPasskeyCreated = _useState22[1];
116
+ componentReady = _useState22[0],
117
+ setComponentReady = _useState22[1];
112
118
  var _useState23 = useState(false),
113
119
  _useState24 = _slicedToArray(_useState23, 2),
114
- walletLoading = _useState24[0],
115
- setWalletLoading = _useState24[1];
120
+ passkeyCreated = _useState24[0],
121
+ setPasskeyCreated = _useState24[1];
116
122
  var handleResendCode = /*#__PURE__*/function () {
117
123
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
118
124
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -146,10 +152,10 @@ var Auth = function Auth(_ref) {
146
152
  }();
147
153
  useEffect(function () {
148
154
  if (authIframeClient) {
149
- setLoading(false);
155
+ setComponentReady(true);
150
156
  }
151
157
  }, [authIframeClient]);
152
- if (loading) {
158
+ if (!componentReady) {
153
159
  return jsx("div", {
154
160
  className: styles.defaultLoader,
155
161
  children: jsx(CircularProgress, {
@@ -167,38 +173,11 @@ var Auth = function Auth(_ref) {
167
173
  var phoneNumber = parsePhoneNumberFromString(phone);
168
174
  return (_phoneNumber$isValid = phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.isValid()) !== null && _phoneNumber$isValid !== void 0 ? _phoneNumber$isValid : false;
169
175
  };
170
- var handleAuthSuccess = /*#__PURE__*/function () {
171
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(credentialBundle, expirationSeconds) {
176
+ var handleSignupWithPasskey = /*#__PURE__*/function () {
177
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
178
+ var siteInfo, _authConfig$sessionLe, _ref4, encodedChallenge, attestation, response;
172
179
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
173
180
  while (1) switch (_context2.prev = _context2.next) {
174
- case 0:
175
- if (!credentialBundle) {
176
- _context2.next = 7;
177
- break;
178
- }
179
- _context2.next = 3;
180
- return authIframeClient.injectCredentialBundle(credentialBundle);
181
- case 3:
182
- _context2.next = 5;
183
- return authIframeClient.loginWithAuthBundle(credentialBundle, expirationSeconds);
184
- case 5:
185
- _context2.next = 7;
186
- return onAuthSuccess();
187
- case 7:
188
- case "end":
189
- return _context2.stop();
190
- }
191
- }, _callee2);
192
- }));
193
- return function handleAuthSuccess(_x, _x2) {
194
- return _ref3.apply(this, arguments);
195
- };
196
- }();
197
- var handleSignupWithPasskey = /*#__PURE__*/function () {
198
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
199
- var siteInfo, _turnkey$config$defau, _ref5, encodedChallenge, attestation, response, sessionResponse, _authConfig$sessionLe;
200
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
201
- while (1) switch (_context3.prev = _context3.next) {
202
181
  case 0:
203
182
  setPasskeySignupError("");
204
183
  siteInfo = "".concat(new URL(window.location.href).hostname, " - ").concat(new Date().toLocaleString(undefined, {
@@ -211,12 +190,12 @@ var Auth = function Auth(_ref) {
211
190
  }));
212
191
  setPasskeySignupScreen(false);
213
192
  setPasskeyCreationScreen(true);
214
- _context3.prev = 4;
193
+ _context2.prev = 4;
215
194
  if (passkeyCreated) {
216
- _context3.next = 22;
195
+ _context2.next = 22;
217
196
  break;
218
197
  }
219
- _context3.next = 8;
198
+ _context2.next = 8;
220
199
  return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.createUserPasskey({
221
200
  publicKey: {
222
201
  user: {
@@ -226,21 +205,21 @@ var Auth = function Auth(_ref) {
226
205
  }
227
206
  });
228
207
  case 8:
229
- _context3.t0 = _context3.sent;
230
- if (_context3.t0) {
231
- _context3.next = 11;
208
+ _context2.t0 = _context2.sent;
209
+ if (_context2.t0) {
210
+ _context2.next = 11;
232
211
  break;
233
212
  }
234
- _context3.t0 = {};
213
+ _context2.t0 = {};
235
214
  case 11:
236
- _ref5 = _context3.t0;
237
- encodedChallenge = _ref5.encodedChallenge;
238
- attestation = _ref5.attestation;
215
+ _ref4 = _context2.t0;
216
+ encodedChallenge = _ref4.encodedChallenge;
217
+ attestation = _ref4.attestation;
239
218
  if (!(encodedChallenge && attestation)) {
240
- _context3.next = 21;
219
+ _context2.next = 21;
241
220
  break;
242
221
  }
243
- _context3.next = 17;
222
+ _context2.next = 17;
244
223
  return server.createSuborg(_objectSpread2({
245
224
  email: email,
246
225
  passkey: {
@@ -252,136 +231,117 @@ var Auth = function Auth(_ref) {
252
231
  customAccounts: customAccounts
253
232
  }));
254
233
  case 17:
255
- response = _context3.sent;
234
+ response = _context2.sent;
256
235
  if (response !== null && response !== void 0 && response.subOrganizationId) {
257
236
  setPasskeyCreated(true);
258
237
  }
259
- _context3.next = 22;
238
+ _context2.next = 22;
260
239
  break;
261
240
  case 21:
262
241
  case 22:
263
- _context3.next = 24;
264
- return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.createReadWriteSession(_objectSpread2(_objectSpread2({
265
- targetPublicKey: authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey
266
- }, authConfig.sessionLengthSeconds !== undefined && {
267
- expirationSeconds: authConfig.sessionLengthSeconds.toString()
268
- }), {}, {
269
- organizationId: (_turnkey$config$defau = turnkey === null || turnkey === void 0 ? void 0 : turnkey.config.defaultOrganizationId) !== null && _turnkey$config$defau !== void 0 ? _turnkey$config$defau : process.env.NEXT_PUBLIC_ORGANIZATION_ID
270
- }));
242
+ _context2.next = 24;
243
+ return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.loginWithPasskey(SessionType.READ_WRITE, authIframeClient, authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey, (_authConfig$sessionLe = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe === void 0 ? void 0 : _authConfig$sessionLe.toString());
271
244
  case 24:
272
- sessionResponse = _context3.sent;
273
- if (!(sessionResponse !== null && sessionResponse !== void 0 && sessionResponse.credentialBundle)) {
274
- _context3.next = 30;
275
- break;
276
- }
277
- _context3.next = 28;
278
- return handleAuthSuccess(sessionResponse.credentialBundle, (_authConfig$sessionLe = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe === void 0 ? void 0 : _authConfig$sessionLe.toString());
279
- case 28:
280
- _context3.next = 31;
281
- break;
282
- case 30:
283
- setPasskeySignupError(authErrors.passkey.loginFailed);
284
- case 31:
285
- _context3.next = 36;
245
+ _context2.next = 26;
246
+ return onAuthSuccess();
247
+ case 26:
248
+ _context2.next = 32;
286
249
  break;
287
- case 33:
288
- _context3.prev = 33;
289
- _context3.t1 = _context3["catch"](4);
250
+ case 28:
251
+ _context2.prev = 28;
252
+ _context2.t1 = _context2["catch"](4);
290
253
  setPasskeySignupError(authErrors.passkey.timeoutOrNotAllowed);
291
- case 36:
254
+ console.error("Error during passkey signup: ", _context2.t1);
255
+ case 32:
292
256
  case "end":
293
- return _context3.stop();
257
+ return _context2.stop();
294
258
  }
295
- }, _callee3, null, [[4, 33]]);
259
+ }, _callee2, null, [[4, 28]]);
296
260
  }));
297
261
  return function handleSignupWithPasskey() {
298
- return _ref4.apply(this, arguments);
262
+ return _ref3.apply(this, arguments);
299
263
  };
300
264
  }();
301
265
  var handleLoginWithPasskey = /*#__PURE__*/function () {
302
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
303
- var _turnkey$config$defau2, sessionResponse, _authConfig$sessionLe2;
304
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
305
- while (1) switch (_context4.prev = _context4.next) {
266
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
267
+ var _authConfig$sessionLe2;
268
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
269
+ while (1) switch (_context3.prev = _context3.next) {
306
270
  case 0:
307
- _context4.prev = 0;
308
- _context4.next = 3;
309
- return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.createReadWriteSession(_objectSpread2(_objectSpread2({
310
- targetPublicKey: authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey
311
- }, authConfig.sessionLengthSeconds !== undefined && {
312
- expirationSeconds: authConfig.sessionLengthSeconds.toString()
313
- }), {}, {
314
- organizationId: (_turnkey$config$defau2 = turnkey === null || turnkey === void 0 ? void 0 : turnkey.config.defaultOrganizationId) !== null && _turnkey$config$defau2 !== void 0 ? _turnkey$config$defau2 : process.env.NEXT_PUBLIC_ORGANIZATION_ID
315
- }));
316
- case 3:
317
- sessionResponse = _context4.sent;
318
- if (!(sessionResponse !== null && sessionResponse !== void 0 && sessionResponse.credentialBundle)) {
319
- _context4.next = 9;
320
- break;
321
- }
322
- _context4.next = 7;
323
- return handleAuthSuccess(sessionResponse.credentialBundle, (_authConfig$sessionLe2 = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe2 === void 0 ? void 0 : _authConfig$sessionLe2.toString());
324
- case 7:
325
- _context4.next = 10;
326
- break;
327
- case 9:
328
- case 10:
329
- _context4.next = 15;
271
+ _context3.prev = 0;
272
+ setLoading("passkey");
273
+ _context3.next = 4;
274
+ return passkeyClient === null || passkeyClient === void 0 ? void 0 : passkeyClient.loginWithPasskey(SessionType.READ_WRITE, authIframeClient, authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey, (_authConfig$sessionLe2 = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe2 === void 0 ? void 0 : _authConfig$sessionLe2.toString());
275
+ case 4:
276
+ _context3.next = 6;
277
+ return onAuthSuccess();
278
+ case 6:
279
+ _context3.next = 12;
330
280
  break;
331
- case 12:
332
- _context4.prev = 12;
333
- _context4.t0 = _context4["catch"](0);
281
+ case 8:
282
+ _context3.prev = 8;
283
+ _context3.t0 = _context3["catch"](0);
334
284
  onError(authErrors.passkey.loginFailed);
285
+ console.error("Error during passkey login: ", _context3.t0);
286
+ case 12:
287
+ _context3.prev = 12;
288
+ setLoading(undefined);
289
+ return _context3.finish(12);
335
290
  case 15:
336
291
  case "end":
337
- return _context4.stop();
292
+ return _context3.stop();
338
293
  }
339
- }, _callee4, null, [[0, 12]]);
294
+ }, _callee3, null, [[0, 8, 12, 15]]);
340
295
  }));
341
296
  return function handleLoginWithPasskey() {
342
- return _ref6.apply(this, arguments);
297
+ return _ref5.apply(this, arguments);
343
298
  };
344
299
  }();
345
300
  var handleOtpLogin = /*#__PURE__*/function () {
346
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(type, value, otpType) {
301
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(type, value, otpType) {
347
302
  var createSuborgData, resp, suborgIds, suborgId, initAuthResponse;
348
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
349
- while (1) switch (_context5.prev = _context5.next) {
303
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
304
+ while (1) switch (_context4.prev = _context4.next) {
350
305
  case 0:
306
+ setLoading(otpType);
351
307
  createSuborgData = {};
352
308
  if (type === FilterType.Email) createSuborgData.email = value;else if (type === FilterType.PhoneNumber) createSuborgData.phoneNumber = value;
353
309
  if (customAccounts) {
354
310
  createSuborgData.customAccounts = customAccounts;
355
311
  }
356
- _context5.next = 5;
312
+ _context4.next = 6;
357
313
  return server.getOrCreateSuborg({
358
314
  filterType: type,
359
315
  filterValue: value,
360
316
  additionalData: createSuborgData
361
317
  });
362
- case 5:
363
- resp = _context5.sent;
318
+ case 6:
319
+ resp = _context4.sent;
364
320
  suborgIds = resp === null || resp === void 0 ? void 0 : resp.subOrganizationIds;
365
321
  if (!(!suborgIds || suborgIds.length === 0)) {
366
- _context5.next = 10;
322
+ _context4.next = 11;
367
323
  break;
368
324
  }
369
325
  onError(authErrors.otp.sendFailed);
370
- return _context5.abrupt("return");
371
- case 10:
326
+ return _context4.abrupt("return");
327
+ case 11:
372
328
  suborgId = suborgIds[0];
373
- _context5.next = 13;
374
- return server.sendOtp(_objectSpread2(_objectSpread2({
329
+ _context4.next = 14;
330
+ return server.sendOtp(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
375
331
  suborgID: suborgId,
376
332
  otpType: otpType,
377
333
  contact: value
378
- }, customSmsMessage && {
334
+ }, emailCustomization && {
335
+ emailCustomization: emailCustomization
336
+ }), sendFromEmailAddress && {
337
+ sendFromEmailAddress: sendFromEmailAddress
338
+ }), customSmsMessage && {
379
339
  customSmsMessage: customSmsMessage
380
340
  }), {}, {
381
341
  userIdentifier: authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey
382
342
  }));
383
- case 13:
384
- initAuthResponse = _context5.sent;
343
+ case 14:
344
+ initAuthResponse = _context4.sent;
385
345
  if (initAuthResponse && initAuthResponse.otpId) {
386
346
  setSuborgId(suborgId);
387
347
  setOtpId(initAuthResponse === null || initAuthResponse === void 0 ? void 0 : initAuthResponse.otpId);
@@ -389,21 +349,22 @@ var Auth = function Auth(_ref) {
389
349
  } else {
390
350
  onError(authErrors.otp.sendFailed);
391
351
  }
392
- case 15:
352
+ setLoading(undefined);
353
+ case 17:
393
354
  case "end":
394
- return _context5.stop();
355
+ return _context4.stop();
395
356
  }
396
- }, _callee5);
357
+ }, _callee4);
397
358
  }));
398
- return function handleOtpLogin(_x3, _x4, _x5) {
399
- return _ref7.apply(this, arguments);
359
+ return function handleOtpLogin(_x, _x2, _x3) {
360
+ return _ref6.apply(this, arguments);
400
361
  };
401
362
  }();
402
363
  var handleOAuthLogin = /*#__PURE__*/function () {
403
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(credential, providerName) {
404
- var createSuborgData, resp, suborgIds, suborgId, oauthResponse, _authConfig$sessionLe3;
405
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
406
- while (1) switch (_context6.prev = _context6.next) {
364
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(credential, providerName) {
365
+ var createSuborgData, resp, suborgIds, suborgId, oauthSession;
366
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
367
+ while (1) switch (_context5.prev = _context5.next) {
407
368
  case 0:
408
369
  setOauthLoading(providerName);
409
370
  createSuborgData = {
@@ -415,24 +376,24 @@ var Auth = function Auth(_ref) {
415
376
  if (customAccounts) {
416
377
  createSuborgData.customAccounts = customAccounts;
417
378
  }
418
- _context6.next = 5;
379
+ _context5.next = 5;
419
380
  return server.getOrCreateSuborg({
420
381
  filterType: FilterType.OidcToken,
421
382
  filterValue: credential,
422
383
  additionalData: createSuborgData
423
384
  });
424
385
  case 5:
425
- resp = _context6.sent;
386
+ resp = _context5.sent;
426
387
  suborgIds = resp === null || resp === void 0 ? void 0 : resp.subOrganizationIds;
427
388
  if (!(!suborgIds || suborgIds.length === 0)) {
428
- _context6.next = 10;
389
+ _context5.next = 10;
429
390
  break;
430
391
  }
431
392
  onError(authErrors.oauth.loginFailed);
432
- return _context6.abrupt("return");
393
+ return _context5.abrupt("return");
433
394
  case 10:
434
395
  suborgId = suborgIds[0];
435
- _context6.next = 13;
396
+ _context5.next = 13;
436
397
  return server.oauth({
437
398
  suborgID: suborgId,
438
399
  oidcToken: credential,
@@ -440,54 +401,57 @@ var Auth = function Auth(_ref) {
440
401
  sessionLengthSeconds: authConfig.sessionLengthSeconds
441
402
  });
442
403
  case 13:
443
- oauthResponse = _context6.sent;
444
- if (!(oauthResponse && oauthResponse.token)) {
445
- _context6.next = 19;
404
+ oauthSession = _context5.sent;
405
+ if (!(oauthSession && oauthSession.token)) {
406
+ _context5.next = 21;
446
407
  break;
447
408
  }
448
- _context6.next = 17;
449
- return handleAuthSuccess(oauthResponse.token, (_authConfig$sessionLe3 = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe3 === void 0 ? void 0 : _authConfig$sessionLe3.toString());
409
+ _context5.next = 17;
410
+ return authIframeClient.loginWithSession(oauthSession);
450
411
  case 17:
451
- _context6.next = 20;
452
- break;
412
+ _context5.next = 19;
413
+ return onAuthSuccess();
453
414
  case 19:
415
+ _context5.next = 22;
416
+ break;
417
+ case 21:
454
418
  onError(authErrors.oauth.loginFailed);
455
- case 20:
419
+ case 22:
456
420
  case "end":
457
- return _context6.stop();
421
+ return _context5.stop();
458
422
  }
459
- }, _callee6);
423
+ }, _callee5);
460
424
  }));
461
- return function handleOAuthLogin(_x6, _x7) {
462
- return _ref8.apply(this, arguments);
425
+ return function handleOAuthLogin(_x4, _x5) {
426
+ return _ref7.apply(this, arguments);
463
427
  };
464
428
  }();
465
429
  var handleLoginWithWallet = /*#__PURE__*/function () {
466
- var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
467
- var publicKey, _walletClient$getWall, type, resp, suborgIds, _suborgId, sessionResponse, _authConfig$sessionLe4;
468
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
469
- while (1) switch (_context7.prev = _context7.next) {
430
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
431
+ var _authConfig$sessionLe3, publicKey, _walletClient$getWall, type, resp, suborgIds;
432
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
433
+ while (1) switch (_context6.prev = _context6.next) {
470
434
  case 0:
471
- setWalletLoading(true);
472
- _context7.prev = 1;
435
+ setLoading("wallet");
436
+ _context6.prev = 1;
473
437
  if (walletClient) {
474
- _context7.next = 4;
438
+ _context6.next = 4;
475
439
  break;
476
440
  }
477
441
  throw new Error("Wallet client not initialized");
478
442
  case 4:
479
- _context7.next = 6;
443
+ _context6.next = 6;
480
444
  return walletClient.getPublicKey();
481
445
  case 6:
482
- publicKey = _context7.sent;
446
+ publicKey = _context6.sent;
483
447
  if (publicKey) {
484
- _context7.next = 9;
448
+ _context6.next = 9;
485
449
  break;
486
450
  }
487
451
  throw new Error(authErrors.wallet.noPublicKey);
488
452
  case 9:
489
453
  _walletClient$getWall = walletClient.getWalletInterface(), type = _walletClient$getWall.type;
490
- _context7.next = 12;
454
+ _context6.next = 12;
491
455
  return server.getOrCreateSuborg({
492
456
  filterType: FilterType.PublicKey,
493
457
  filterValue: publicKey,
@@ -499,56 +463,40 @@ var Auth = function Auth(_ref) {
499
463
  }
500
464
  });
501
465
  case 12:
502
- resp = _context7.sent;
466
+ resp = _context6.sent;
503
467
  suborgIds = resp === null || resp === void 0 ? void 0 : resp.subOrganizationIds;
504
468
  if (!(!suborgIds || suborgIds.length === 0)) {
505
- _context7.next = 17;
469
+ _context6.next = 17;
506
470
  break;
507
471
  }
508
472
  onError(authErrors.wallet.loginFailed);
509
- return _context7.abrupt("return");
473
+ return _context6.abrupt("return");
510
474
  case 17:
511
- _suborgId = suborgIds[0];
512
- _context7.next = 20;
513
- return walletClient.createReadWriteSession(_objectSpread2(_objectSpread2({
514
- targetPublicKey: authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey
515
- }, _suborgId && {
516
- organizationId: _suborgId
517
- }), authConfig.sessionLengthSeconds !== undefined && {
518
- expirationSeconds: authConfig.sessionLengthSeconds.toString()
519
- }));
520
- case 20:
521
- sessionResponse = _context7.sent;
522
- if (!(sessionResponse !== null && sessionResponse !== void 0 && sessionResponse.credentialBundle)) {
523
- _context7.next = 26;
524
- break;
525
- }
526
- _context7.next = 24;
527
- return handleAuthSuccess(sessionResponse.credentialBundle, (_authConfig$sessionLe4 = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe4 === void 0 ? void 0 : _authConfig$sessionLe4.toString());
528
- case 24:
529
- _context7.next = 27;
475
+ _context6.next = 19;
476
+ return walletClient.loginWithWallet(SessionType.READ_WRITE, authIframeClient, authIframeClient === null || authIframeClient === void 0 ? void 0 : authIframeClient.iframePublicKey, (_authConfig$sessionLe3 = authConfig.sessionLengthSeconds) === null || _authConfig$sessionLe3 === void 0 ? void 0 : _authConfig$sessionLe3.toString());
477
+ case 19:
478
+ _context6.next = 21;
479
+ return onAuthSuccess();
480
+ case 21:
481
+ _context6.next = 27;
530
482
  break;
531
- case 26:
532
- throw new Error(authErrors.wallet.loginFailed);
483
+ case 23:
484
+ _context6.prev = 23;
485
+ _context6.t0 = _context6["catch"](1);
486
+ onError(_context6.t0.message || authErrors.wallet.loginFailed);
487
+ console.error("Error during wallet login: ", _context6.t0);
533
488
  case 27:
534
- _context7.next = 32;
535
- break;
536
- case 29:
537
- _context7.prev = 29;
538
- _context7.t0 = _context7["catch"](1);
539
- onError(_context7.t0.message || authErrors.wallet.loginFailed);
540
- case 32:
541
- _context7.prev = 32;
542
- setWalletLoading(false);
543
- return _context7.finish(32);
544
- case 35:
489
+ _context6.prev = 27;
490
+ setLoading(undefined);
491
+ return _context6.finish(27);
492
+ case 30:
545
493
  case "end":
546
- return _context7.stop();
494
+ return _context6.stop();
547
495
  }
548
- }, _callee7, null, [[1, 29, 32, 35]]);
496
+ }, _callee6, null, [[1, 23, 27, 30]]);
549
497
  }));
550
498
  return function handleLoginWithWallet() {
551
- return _ref9.apply(this, arguments);
499
+ return _ref8.apply(this, arguments);
552
500
  };
553
501
  }();
554
502
  var renderBackButton = function renderBackButton() {
@@ -648,8 +596,12 @@ var Auth = function Auth(_ref) {
648
596
  }), jsx("button", {
649
597
  className: styles.authButton,
650
598
  type: "submit",
651
- disabled: !isValidEmail(email),
652
- children: "Continue"
599
+ disabled: !isValidEmail(email) || loading === OtpType.Email,
600
+ children: loading === OtpType.Email ? jsx(CircularProgress, {
601
+ size: 24,
602
+ thickness: 4,
603
+ className: styles.buttonProgress || ""
604
+ }) : "Continue"
653
605
  })]
654
606
  }) : null;
655
607
  case "phone":
@@ -669,8 +621,12 @@ var Auth = function Auth(_ref) {
669
621
  }), jsx("button", {
670
622
  className: styles.authButton,
671
623
  type: "submit",
672
- disabled: !isValidPhone(phone),
673
- children: "Continue"
624
+ disabled: !isValidPhone(phone) || loading === OtpType.Sms,
625
+ children: loading === OtpType.Sms ? jsx(CircularProgress, {
626
+ size: 24,
627
+ thickness: 4,
628
+ className: styles.buttonProgress || ""
629
+ }) : "Continue"
674
630
  })]
675
631
  }) : null;
676
632
  case "passkey":
@@ -680,7 +636,12 @@ var Auth = function Auth(_ref) {
680
636
  className: styles.authButton,
681
637
  type: "button",
682
638
  onClick: handleLoginWithPasskey,
683
- children: "Log in with passkey"
639
+ disabled: loading === "passkey",
640
+ children: loading === "passkey" ? jsx(CircularProgress, {
641
+ size: 24,
642
+ thickness: 4,
643
+ className: styles.buttonProgress || ""
644
+ }) : "Log in with passkey"
684
645
  }), jsx("div", {
685
646
  className: styles.noPasskeyLink,
686
647
  onClick: function onClick() {
@@ -696,8 +657,8 @@ var Auth = function Auth(_ref) {
696
657
  className: styles.authButton,
697
658
  type: "button",
698
659
  onClick: handleLoginWithWallet,
699
- disabled: walletLoading,
700
- children: walletLoading ? jsx(CircularProgress, {
660
+ disabled: loading === "wallet",
661
+ children: loading === "wallet" ? jsx(CircularProgress, {
701
662
  size: 24,
702
663
  thickness: 4,
703
664
  className: styles.buttonProgress || ""
@@ -822,8 +783,7 @@ var Auth = function Auth(_ref) {
822
783
  suborgId: suborgId,
823
784
  otpId: otpId,
824
785
  sessionLengthSeconds: authConfig.sessionLengthSeconds,
825
- authIframeClient: authIframeClient,
826
- onValidateSuccess: handleAuthSuccess,
786
+ onValidateSuccess: onAuthSuccess,
827
787
  onResendCode: handleResendCode
828
788
  }), !otpId && jsx("div", {
829
789
  className: styles.tos,
@@ -859,5 +819,5 @@ var Auth = function Auth(_ref) {
859
819
  });
860
820
  };
861
821
 
862
- export { Auth as default };
822
+ export { SessionType, Auth as default };
863
823
  //# sourceMappingURL=Auth.mjs.map