@jetthai/cuora 1.1.318-tg-1 → 1.1.319
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 +1 -3
- package/package.json +1 -1
- package/src/api/auth.js +2 -2
- package/src/machine/auth.js +0 -16
- package/src/request/request.js +6 -3
- package/src/util/deviceToken.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
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.
|
|
6
|
-
|
|
7
|
-
### [1.1.318-tg](https://github.com/jetthai/cuora-module/compare/v1.1.318...v1.1.318-tg) (2024-11-19)
|
|
5
|
+
### [1.1.319](https://github.com/jetthai/cuora-module/compare/v1.1.318...v1.1.319) (2024-11-26)
|
|
8
6
|
|
|
9
7
|
### [1.1.318](https://github.com/jetthai/cuora-module/compare/v1.1.317...v1.1.318) (2024-11-11)
|
|
10
8
|
|
package/package.json
CHANGED
package/src/api/auth.js
CHANGED
|
@@ -5,10 +5,10 @@ export default {
|
|
|
5
5
|
method: 'post',
|
|
6
6
|
isPublic: true,
|
|
7
7
|
}),
|
|
8
|
-
login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken
|
|
8
|
+
login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken }) => ({
|
|
9
9
|
url: 'login',
|
|
10
10
|
method: 'post',
|
|
11
|
-
params: { username, password, provider, countryCode, phone, email, dt
|
|
11
|
+
params: { username, password, provider, countryCode, phone, email, dt },
|
|
12
12
|
isPublic: true,
|
|
13
13
|
headers: { 'x-access-captcha': reCaptchaToken },
|
|
14
14
|
}),
|
package/src/machine/auth.js
CHANGED
|
@@ -33,7 +33,6 @@ export default function (request) {
|
|
|
33
33
|
email: null,
|
|
34
34
|
username: null,
|
|
35
35
|
password: null,
|
|
36
|
-
additionalUserInfo: null,
|
|
37
36
|
},
|
|
38
37
|
countryAbbr: null,
|
|
39
38
|
userInfo: {},
|
|
@@ -272,10 +271,6 @@ export default function (request) {
|
|
|
272
271
|
LOGIN_APP: {
|
|
273
272
|
target: '.authenticationApp',
|
|
274
273
|
},
|
|
275
|
-
LOGIN_TELEGRAM: {
|
|
276
|
-
target: '.authentication',
|
|
277
|
-
actions: 'setLoginTelegram',
|
|
278
|
-
},
|
|
279
274
|
SET_PLAY: {
|
|
280
275
|
actions: 'setPlay',
|
|
281
276
|
},
|
|
@@ -358,17 +353,6 @@ export default function (request) {
|
|
|
358
353
|
},
|
|
359
354
|
}
|
|
360
355
|
}),
|
|
361
|
-
setLoginTelegram: assign((context, event) => {
|
|
362
|
-
const { loginType, additionalUserInfo, isSignature } = event.data
|
|
363
|
-
return {
|
|
364
|
-
loginData: {
|
|
365
|
-
provider: 'telegram',
|
|
366
|
-
loginType,
|
|
367
|
-
additionalUserInfo,
|
|
368
|
-
isSignature,
|
|
369
|
-
},
|
|
370
|
-
}
|
|
371
|
-
}),
|
|
372
356
|
fetchToken: assign((context, event) => {
|
|
373
357
|
const token = storage.get(tokenKey)
|
|
374
358
|
return {
|
package/src/request/request.js
CHANGED
|
@@ -65,10 +65,12 @@ export default class Request {
|
|
|
65
65
|
const { data } = await this.axios.request(requestConfig)
|
|
66
66
|
return data
|
|
67
67
|
} catch (error) {
|
|
68
|
-
if (error.code) {
|
|
69
|
-
|
|
68
|
+
if (error.code !== 'ERR_800') {
|
|
69
|
+
if (error.code) {
|
|
70
|
+
this.errorHandler && this.errorHandler(error)
|
|
71
|
+
}
|
|
72
|
+
throw error
|
|
70
73
|
}
|
|
71
|
-
throw error
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
|
|
@@ -108,6 +110,7 @@ export default class Request {
|
|
|
108
110
|
|
|
109
111
|
_checkToken(req) {
|
|
110
112
|
if (!req.isPublic && !this.getToken()) {
|
|
113
|
+
console.error(req)
|
|
111
114
|
throw { code: 'ERR_A103', url: req.url }
|
|
112
115
|
}
|
|
113
116
|
}
|
package/src/util/deviceToken.js
CHANGED
|
@@ -23,6 +23,7 @@ const getDeviceToken = async ({ fpToken, sentry, hosts, enable = true }) => {
|
|
|
23
23
|
throw new Error('[Device Token] No token from FingerprintJS.')
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
console.log('[Device Token]', `${dt} from ${endpoints}`)
|
|
26
27
|
sentry?.setTag('dt', dt)
|
|
27
28
|
} catch (error) {
|
|
28
29
|
console.error('[Device Token]', `${dt} from ${endpoints}`, error)
|