@basiq/connect-auth 0.1.84 → 0.1.87
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 +25 -14
- 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 +25 -14
- package/dist/connect-auth.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +3 -5
|
@@ -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],
|
|
@@ -1041,9 +1048,11 @@ function StartScreen(props) {
|
|
|
1041
1048
|
case 4:
|
|
1042
1049
|
response = _context.sent;
|
|
1043
1050
|
|
|
1044
|
-
if (
|
|
1051
|
+
if (response != null && (_response$data = response.data) != null && _response$data.ok) {
|
|
1045
1052
|
setLoading(false);
|
|
1046
1053
|
onContinue();
|
|
1054
|
+
} else {
|
|
1055
|
+
showErrorScreen(response == null ? void 0 : response.statusCode.toString());
|
|
1047
1056
|
}
|
|
1048
1057
|
|
|
1049
1058
|
case 6:
|
|
@@ -1304,7 +1313,7 @@ function App() {
|
|
|
1304
1313
|
id = window.location.pathname.substring(1);
|
|
1305
1314
|
|
|
1306
1315
|
if (!((id == null ? void 0 : id.length) > 0)) {
|
|
1307
|
-
_context.next =
|
|
1316
|
+
_context.next = 10;
|
|
1308
1317
|
break;
|
|
1309
1318
|
}
|
|
1310
1319
|
|
|
@@ -1316,7 +1325,7 @@ function App() {
|
|
|
1316
1325
|
case 6:
|
|
1317
1326
|
response = _context.sent;
|
|
1318
1327
|
|
|
1319
|
-
if (
|
|
1328
|
+
if (response != null && (_response$data = response.data) != null && _response$data.ok) {
|
|
1320
1329
|
setCurrentScreen(1);
|
|
1321
1330
|
setMobile(response == null ? void 0 : (_response$data2 = response.data) == null ? void 0 : _response$data2.mobile);
|
|
1322
1331
|
|
|
@@ -1331,13 +1340,15 @@ function App() {
|
|
|
1331
1340
|
showErrorScreen(response == null ? void 0 : response.statusCode.toString());
|
|
1332
1341
|
}
|
|
1333
1342
|
|
|
1334
|
-
|
|
1335
|
-
_context.next = 12;
|
|
1343
|
+
_context.next = 11;
|
|
1336
1344
|
break;
|
|
1337
1345
|
|
|
1338
|
-
case
|
|
1346
|
+
case 10:
|
|
1339
1347
|
showErrorScreen('404');
|
|
1340
1348
|
|
|
1349
|
+
case 11:
|
|
1350
|
+
setLoading(false);
|
|
1351
|
+
|
|
1341
1352
|
case 12:
|
|
1342
1353
|
case "end":
|
|
1343
1354
|
return _context.stop();
|