@turnkey/sdk-react 3.0.2 → 3.0.3
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.
|
@@ -17,6 +17,7 @@ import OtpVerification from './OtpVerification.mjs';
|
|
|
17
17
|
import { useTurnkey } from '../../hooks/use-turnkey.mjs';
|
|
18
18
|
import { OtpType, FilterType, authErrors } from './constants.mjs';
|
|
19
19
|
import { server } from '@turnkey/sdk-server';
|
|
20
|
+
import parsePhoneNumberFromString from 'libphonenumber-js';
|
|
20
21
|
|
|
21
22
|
var passkeyIcon = jsxs("svg", {
|
|
22
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -157,7 +158,9 @@ var Auth = function Auth(_ref) {
|
|
|
157
158
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
158
159
|
};
|
|
159
160
|
var isValidPhone = function isValidPhone(phone) {
|
|
160
|
-
|
|
161
|
+
var _phoneNumber$isValid;
|
|
162
|
+
var phoneNumber = parsePhoneNumberFromString(phone);
|
|
163
|
+
return (_phoneNumber$isValid = phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.isValid()) !== null && _phoneNumber$isValid !== void 0 ? _phoneNumber$isValid : false;
|
|
161
164
|
};
|
|
162
165
|
var handleGetOrCreateSuborg = /*#__PURE__*/function () {
|
|
163
166
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(filterType, filterValue) {
|