@jetthai/cuora 1.1.51 → 1.1.52
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 +2 -0
- package/dist/bundle.mjs +17 -6
- package/package.json +1 -1
- package/src/machine/auth_otp_v2.js +10 -4
- package/src/machine/auth_otp_v3.js +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.52](https://github.com/jetthai/cuora-module/compare/v1.1.51...v1.1.52) (2023-02-20)
|
|
6
|
+
|
|
5
7
|
### [1.1.51](https://github.com/jetthai/cuora-module/compare/v1.1.48-1...v1.1.51) (2023-02-17)
|
|
6
8
|
|
|
7
9
|
### [1.1.50](https://github.com/jetthai/cuora-module/compare/v1.1.49...v1.1.50) (2023-02-16)
|
package/dist/bundle.mjs
CHANGED
|
@@ -20812,10 +20812,16 @@ function auth_otp_v2 (request) {
|
|
|
20812
20812
|
otpFetching: {
|
|
20813
20813
|
invoke: {
|
|
20814
20814
|
src: 'sendOtp',
|
|
20815
|
-
onDone:
|
|
20816
|
-
|
|
20817
|
-
|
|
20818
|
-
|
|
20815
|
+
onDone: [
|
|
20816
|
+
{
|
|
20817
|
+
target: 'acknowledged',
|
|
20818
|
+
cond: (context, event) => event.data.status === 'success-verified',
|
|
20819
|
+
},
|
|
20820
|
+
{
|
|
20821
|
+
target: 'otp',
|
|
20822
|
+
actions: 'setOtpResult',
|
|
20823
|
+
},
|
|
20824
|
+
],
|
|
20819
20825
|
onError: {
|
|
20820
20826
|
target: 'idle',
|
|
20821
20827
|
},
|
|
@@ -20962,6 +20968,7 @@ function auth_otp_v3 (request) {
|
|
|
20962
20968
|
email: null,
|
|
20963
20969
|
target: null,
|
|
20964
20970
|
requestId: null,
|
|
20971
|
+
status: null,
|
|
20965
20972
|
ttl: 0,
|
|
20966
20973
|
},
|
|
20967
20974
|
states: {
|
|
@@ -21061,7 +21068,7 @@ function auth_otp_v3 (request) {
|
|
|
21061
21068
|
},
|
|
21062
21069
|
},
|
|
21063
21070
|
verification: {
|
|
21064
|
-
|
|
21071
|
+
always: [{ target: '#auth_otp.verified', cond: 'isAutoVerified' }, { target: '.idle' }],
|
|
21065
21072
|
states: {
|
|
21066
21073
|
idle: {
|
|
21067
21074
|
on: {
|
|
@@ -21120,11 +21127,12 @@ function auth_otp_v3 (request) {
|
|
|
21120
21127
|
}
|
|
21121
21128
|
}),
|
|
21122
21129
|
setVerificationData: assign((context, event) => {
|
|
21123
|
-
const { requestId, ttl, target } = event.data;
|
|
21130
|
+
const { requestId, ttl, target, status } = event.data;
|
|
21124
21131
|
return {
|
|
21125
21132
|
requestId,
|
|
21126
21133
|
ttl: ttl * 1000,
|
|
21127
21134
|
target,
|
|
21135
|
+
status,
|
|
21128
21136
|
}
|
|
21129
21137
|
}),
|
|
21130
21138
|
decreaseTtl: assign((context, evnet) => {
|
|
@@ -21171,6 +21179,9 @@ function auth_otp_v3 (request) {
|
|
|
21171
21179
|
const { error } = context;
|
|
21172
21180
|
return error.code === 'ERR_F106'
|
|
21173
21181
|
},
|
|
21182
|
+
isAutoVerified: (context, event) => {
|
|
21183
|
+
return context.status === 'success-verified'
|
|
21184
|
+
},
|
|
21174
21185
|
},
|
|
21175
21186
|
services: {
|
|
21176
21187
|
fetchUserInfo: async (context, event) => {
|
package/package.json
CHANGED
|
@@ -34,10 +34,16 @@ export default function (request) {
|
|
|
34
34
|
otpFetching: {
|
|
35
35
|
invoke: {
|
|
36
36
|
src: 'sendOtp',
|
|
37
|
-
onDone:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
onDone: [
|
|
38
|
+
{
|
|
39
|
+
target: 'acknowledged',
|
|
40
|
+
cond: (context, event) => event.data.status === 'success-verified',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
target: 'otp',
|
|
44
|
+
actions: 'setOtpResult',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
41
47
|
onError: {
|
|
42
48
|
target: 'idle',
|
|
43
49
|
},
|
|
@@ -16,6 +16,7 @@ export default function (request) {
|
|
|
16
16
|
email: null,
|
|
17
17
|
target: null,
|
|
18
18
|
requestId: null,
|
|
19
|
+
status: null,
|
|
19
20
|
ttl: 0,
|
|
20
21
|
},
|
|
21
22
|
states: {
|
|
@@ -115,7 +116,7 @@ export default function (request) {
|
|
|
115
116
|
},
|
|
116
117
|
},
|
|
117
118
|
verification: {
|
|
118
|
-
|
|
119
|
+
always: [{ target: '#auth_otp.verified', cond: 'isAutoVerified' }, { target: '.idle' }],
|
|
119
120
|
states: {
|
|
120
121
|
idle: {
|
|
121
122
|
on: {
|
|
@@ -174,11 +175,12 @@ export default function (request) {
|
|
|
174
175
|
}
|
|
175
176
|
}),
|
|
176
177
|
setVerificationData: assign((context, event) => {
|
|
177
|
-
const { requestId, ttl, target } = event.data
|
|
178
|
+
const { requestId, ttl, target, status } = event.data
|
|
178
179
|
return {
|
|
179
180
|
requestId,
|
|
180
181
|
ttl: ttl * 1000,
|
|
181
182
|
target,
|
|
183
|
+
status,
|
|
182
184
|
}
|
|
183
185
|
}),
|
|
184
186
|
decreaseTtl: assign((context, evnet) => {
|
|
@@ -225,6 +227,9 @@ export default function (request) {
|
|
|
225
227
|
const { error } = context
|
|
226
228
|
return error.code === 'ERR_F106'
|
|
227
229
|
},
|
|
230
|
+
isAutoVerified: (context, event) => {
|
|
231
|
+
return context.status === 'success-verified'
|
|
232
|
+
},
|
|
228
233
|
},
|
|
229
234
|
services: {
|
|
230
235
|
fetchUserInfo: async (context, event) => {
|