@basiq/connect-auth 0.1.85 → 0.1.88
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/dist/actions/actions.d.ts +4 -0
- package/dist/{BasiqConnect.d.ts → components/BasiqConnect.d.ts} +1 -1
- package/dist/connect-auth.cjs.development.js +32 -22
- package/dist/connect-auth.cjs.development.js.map +1 -1
- package/dist/connect-auth.cjs.production.min.js +1 -1
- package/dist/connect-auth.cjs.production.min.js.map +1 -1
- package/dist/connect-auth.esm.js +32 -22
- package/dist/connect-auth.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -3
|
@@ -2,21 +2,25 @@ export declare const verifySmsCode: (authRequestId: string, smsCode: string) =>
|
|
|
2
2
|
data: any;
|
|
3
3
|
headers: Headers;
|
|
4
4
|
statusCode: number;
|
|
5
|
+
ok: boolean;
|
|
5
6
|
error?: undefined;
|
|
6
7
|
} | {
|
|
7
8
|
headers: Headers;
|
|
8
9
|
statusCode: number;
|
|
9
10
|
error: string;
|
|
11
|
+
ok: boolean;
|
|
10
12
|
data?: undefined;
|
|
11
13
|
}>;
|
|
12
14
|
export declare const authUser: (authRequestId: string, method?: 'POST' | 'GET') => Promise<{
|
|
13
15
|
data: any;
|
|
14
16
|
headers: Headers;
|
|
15
17
|
statusCode: number;
|
|
18
|
+
ok: boolean;
|
|
16
19
|
error?: undefined;
|
|
17
20
|
} | {
|
|
18
21
|
headers: Headers;
|
|
19
22
|
statusCode: number;
|
|
20
23
|
error: any;
|
|
24
|
+
ok: boolean;
|
|
21
25
|
data?: undefined;
|
|
22
26
|
}>;
|
|
@@ -830,7 +830,8 @@ var verifySmsCode = /*#__PURE__*/function () {
|
|
|
830
830
|
return _context.abrupt("return", {
|
|
831
831
|
data: json,
|
|
832
832
|
headers: result.headers,
|
|
833
|
-
statusCode: result.status
|
|
833
|
+
statusCode: result.status,
|
|
834
|
+
ok: true
|
|
834
835
|
});
|
|
835
836
|
|
|
836
837
|
case 15:
|
|
@@ -842,14 +843,16 @@ var verifySmsCode = /*#__PURE__*/function () {
|
|
|
842
843
|
return _context.abrupt("return", {
|
|
843
844
|
headers: result.headers,
|
|
844
845
|
statusCode: result.status,
|
|
845
|
-
error: result.statusText || 'Something went wrong'
|
|
846
|
+
error: result.statusText || 'Something went wrong',
|
|
847
|
+
ok: false
|
|
846
848
|
});
|
|
847
849
|
|
|
848
850
|
case 17:
|
|
849
851
|
return _context.abrupt("return", {
|
|
850
852
|
headers: result.headers,
|
|
851
853
|
statusCode: result.status,
|
|
852
|
-
error: result.statusText || 'Something went wrong'
|
|
854
|
+
error: result.statusText || 'Something went wrong',
|
|
855
|
+
ok: false
|
|
853
856
|
});
|
|
854
857
|
|
|
855
858
|
case 18:
|
|
@@ -914,7 +917,8 @@ var authUser = /*#__PURE__*/function () {
|
|
|
914
917
|
return _context2.abrupt("return", {
|
|
915
918
|
data: json,
|
|
916
919
|
headers: result.headers,
|
|
917
|
-
statusCode: result.status
|
|
920
|
+
statusCode: result.status,
|
|
921
|
+
ok: true
|
|
918
922
|
});
|
|
919
923
|
|
|
920
924
|
case 15:
|
|
@@ -923,7 +927,7 @@ var authUser = /*#__PURE__*/function () {
|
|
|
923
927
|
break;
|
|
924
928
|
}
|
|
925
929
|
|
|
926
|
-
if (!(result.status
|
|
930
|
+
if (![403, 404].includes(result.status)) {
|
|
927
931
|
_context2.next = 20;
|
|
928
932
|
break;
|
|
929
933
|
}
|
|
@@ -944,14 +948,16 @@ var authUser = /*#__PURE__*/function () {
|
|
|
944
948
|
return _context2.abrupt("return", {
|
|
945
949
|
headers: result.headers,
|
|
946
950
|
statusCode: result.status,
|
|
947
|
-
error: _json.message || result.statusText || 'Something went wrong'
|
|
951
|
+
error: (_json == null ? void 0 : _json.message) || result.statusText || 'Something went wrong',
|
|
952
|
+
ok: false
|
|
948
953
|
});
|
|
949
954
|
|
|
950
955
|
case 25:
|
|
951
956
|
return _context2.abrupt("return", {
|
|
952
957
|
headers: result.headers,
|
|
953
958
|
statusCode: result.status,
|
|
954
|
-
error: result.statusText || 'Something went wrong'
|
|
959
|
+
error: result.statusText || 'Something went wrong',
|
|
960
|
+
ok: false
|
|
955
961
|
});
|
|
956
962
|
|
|
957
963
|
case 26:
|
|
@@ -1011,7 +1017,8 @@ function StartScreen(props) {
|
|
|
1011
1017
|
var onContinue = props.onContinue,
|
|
1012
1018
|
appName = props.appName,
|
|
1013
1019
|
shadow = props.shadow,
|
|
1014
|
-
authId = props.authId
|
|
1020
|
+
authId = props.authId,
|
|
1021
|
+
showErrorScreen = props.showErrorScreen;
|
|
1015
1022
|
|
|
1016
1023
|
var _useState = React.useState(false),
|
|
1017
1024
|
loading = _useState[0],
|
|
@@ -1022,8 +1029,7 @@ function StartScreen(props) {
|
|
|
1022
1029
|
|
|
1023
1030
|
var handleContinue = /*#__PURE__*/function () {
|
|
1024
1031
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
1025
|
-
var
|
|
1026
|
-
|
|
1032
|
+
var response;
|
|
1027
1033
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1028
1034
|
while (1) {
|
|
1029
1035
|
switch (_context.prev = _context.next) {
|
|
@@ -1041,9 +1047,11 @@ function StartScreen(props) {
|
|
|
1041
1047
|
case 4:
|
|
1042
1048
|
response = _context.sent;
|
|
1043
1049
|
|
|
1044
|
-
if (
|
|
1050
|
+
if (response != null && response.ok) {
|
|
1045
1051
|
setLoading(false);
|
|
1046
1052
|
onContinue();
|
|
1053
|
+
} else {
|
|
1054
|
+
showErrorScreen(response == null ? void 0 : response.statusCode.toString());
|
|
1047
1055
|
}
|
|
1048
1056
|
|
|
1049
1057
|
case 6:
|
|
@@ -1295,7 +1303,7 @@ function App() {
|
|
|
1295
1303
|
React.useEffect(function () {
|
|
1296
1304
|
var getData = /*#__PURE__*/function () {
|
|
1297
1305
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
1298
|
-
var id,
|
|
1306
|
+
var id, response, _response$data, _response$data2, _response$data4, _response$data4$partn, _response$data3, _response$data5, _response$data5$partn;
|
|
1299
1307
|
|
|
1300
1308
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1301
1309
|
while (1) {
|
|
@@ -1304,7 +1312,7 @@ function App() {
|
|
|
1304
1312
|
id = window.location.pathname.substring(1);
|
|
1305
1313
|
|
|
1306
1314
|
if (!((id == null ? void 0 : id.length) > 0)) {
|
|
1307
|
-
_context.next =
|
|
1315
|
+
_context.next = 10;
|
|
1308
1316
|
break;
|
|
1309
1317
|
}
|
|
1310
1318
|
|
|
@@ -1316,28 +1324,30 @@ function App() {
|
|
|
1316
1324
|
case 6:
|
|
1317
1325
|
response = _context.sent;
|
|
1318
1326
|
|
|
1319
|
-
if (
|
|
1327
|
+
if (response != null && response.ok) {
|
|
1320
1328
|
setCurrentScreen(1);
|
|
1321
|
-
setMobile(response == null ? void 0 : (_response$
|
|
1329
|
+
setMobile(response == null ? void 0 : (_response$data = response.data) == null ? void 0 : _response$data.mobile);
|
|
1322
1330
|
|
|
1323
|
-
if (response != null && (_response$
|
|
1324
|
-
setAppName(response == null ? void 0 : (_response$
|
|
1331
|
+
if (response != null && (_response$data2 = response.data) != null && _response$data2.appName) {
|
|
1332
|
+
setAppName(response == null ? void 0 : (_response$data3 = response.data) == null ? void 0 : _response$data3.appName);
|
|
1325
1333
|
}
|
|
1326
1334
|
|
|
1327
|
-
if (response != null && (_response$
|
|
1328
|
-
setLogo(response == null ? void 0 : (_response$
|
|
1335
|
+
if (response != null && (_response$data4 = response.data) != null && (_response$data4$partn = _response$data4.partner) != null && _response$data4$partn.logoUrl) {
|
|
1336
|
+
setLogo(response == null ? void 0 : (_response$data5 = response.data) == null ? void 0 : (_response$data5$partn = _response$data5.partner) == null ? void 0 : _response$data5$partn.logoUrl);
|
|
1329
1337
|
}
|
|
1330
1338
|
} else {
|
|
1331
1339
|
showErrorScreen(response == null ? void 0 : response.statusCode.toString());
|
|
1332
1340
|
}
|
|
1333
1341
|
|
|
1334
|
-
|
|
1335
|
-
_context.next = 12;
|
|
1342
|
+
_context.next = 11;
|
|
1336
1343
|
break;
|
|
1337
1344
|
|
|
1338
|
-
case
|
|
1345
|
+
case 10:
|
|
1339
1346
|
showErrorScreen('404');
|
|
1340
1347
|
|
|
1348
|
+
case 11:
|
|
1349
|
+
setLoading(false);
|
|
1350
|
+
|
|
1341
1351
|
case 12:
|
|
1342
1352
|
case "end":
|
|
1343
1353
|
return _context.stop();
|