@jetthai/cuora 1.1.441-dev.0 → 1.1.441-dev.1
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 +11 -0
- package/package.json +1 -1
- package/src/api/auth.js +2 -2
- package/src/machine/auth.js +2 -10
- package/src/machine/user_sign_up.js +10 -68
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
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.441-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.441-dev.0...v1.1.441-dev.1) (2026-06-15)
|
|
6
|
+
|
|
7
|
+
### [1.1.441](https://github.com/jetthai/cuora-module/compare/v1.1.440...v1.1.441) (2026-06-13)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([e9a81da](https://github.com/jetthai/cuora-module/commit/e9a81dab7e15cbfedc39d90078bde58db467f2c1))
|
|
13
|
+
|
|
14
|
+
### [1.1.440](https://github.com/jetthai/cuora-module/compare/v1.1.439-dev.7...v1.1.440) (2026-06-09)
|
|
15
|
+
|
|
5
16
|
### [1.1.441-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.439-dev.7...v1.1.441-dev.0) (2026-06-13)
|
|
6
17
|
|
|
7
18
|
|
package/package.json
CHANGED
package/src/api/auth.js
CHANGED
|
@@ -31,8 +31,8 @@ export default {
|
|
|
31
31
|
},
|
|
32
32
|
isPublic: true,
|
|
33
33
|
}),
|
|
34
|
-
register: ({
|
|
35
|
-
const params = pickBy({
|
|
34
|
+
register: ({ ac, fc = null, reCaptchaToken, dt, ...rest }) => {
|
|
35
|
+
const params = pickBy({ ac, fc }, (value) => {
|
|
36
36
|
return value !== undefined && value !== null
|
|
37
37
|
})
|
|
38
38
|
const qs = Object.keys(params)
|
package/src/machine/auth.js
CHANGED
|
@@ -7,7 +7,7 @@ import common from '../api/common.js'
|
|
|
7
7
|
import pickBy from 'lodash/pickBy.js'
|
|
8
8
|
|
|
9
9
|
export default function (request) {
|
|
10
|
-
const { appSecret, clientId, sentry
|
|
10
|
+
const { appSecret, clientId, sentry } = request.config
|
|
11
11
|
const tokenKey = `cuora_${clientId}`
|
|
12
12
|
const userKey = `cuora_tempuser`
|
|
13
13
|
const phoneCountryCode = 'phone_countrycode'
|
|
@@ -464,7 +464,7 @@ export default function (request) {
|
|
|
464
464
|
return { token }
|
|
465
465
|
}),
|
|
466
466
|
redirectTo3Party: async (context, event) => {
|
|
467
|
-
const { provider,
|
|
467
|
+
const { provider, fc } = event.data
|
|
468
468
|
const deviceTokenEnable = context.siteConfig?.dtVerify
|
|
469
469
|
|
|
470
470
|
const dt = deviceTokenEnable ? await request.config.getDt?.() : undefined
|
|
@@ -476,11 +476,6 @@ export default function (request) {
|
|
|
476
476
|
const email = storage.get('tp_email')
|
|
477
477
|
const messages = {
|
|
478
478
|
url: window.location.href,
|
|
479
|
-
channelOrders: [
|
|
480
|
-
{ channel: storage.get('channel'), subchannel: storage.get('subchannel') },
|
|
481
|
-
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
482
|
-
{ channel: channel, subchannel: subchannel },
|
|
483
|
-
],
|
|
484
479
|
affiliateCode,
|
|
485
480
|
nickname,
|
|
486
481
|
}
|
|
@@ -508,9 +503,6 @@ export default function (request) {
|
|
|
508
503
|
referralObj.email = email
|
|
509
504
|
}
|
|
510
505
|
|
|
511
|
-
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
512
|
-
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
513
|
-
|
|
514
506
|
storage.remove('tp_phone')
|
|
515
507
|
storage.remove('tp_countryCode')
|
|
516
508
|
storage.remove('tp_email')
|
|
@@ -3,15 +3,13 @@ import auth from '../api/auth.js'
|
|
|
3
3
|
import storage from '../util/storage.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
|
-
const { sentry
|
|
6
|
+
const { sentry } = request.config
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
9
9
|
id: 'user_sign_up',
|
|
10
10
|
initial: 'idle',
|
|
11
11
|
context: {
|
|
12
12
|
provider: null,
|
|
13
|
-
channel: null,
|
|
14
|
-
subchannel: null,
|
|
15
13
|
signUpData: {},
|
|
16
14
|
fc: null,
|
|
17
15
|
reCaptchaToken: null,
|
|
@@ -74,22 +72,8 @@ export default function (request) {
|
|
|
74
72
|
return { fc }
|
|
75
73
|
}),
|
|
76
74
|
setSignUpId: assign((context, event) => {
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
username,
|
|
80
|
-
nick_name,
|
|
81
|
-
password,
|
|
82
|
-
countryCode,
|
|
83
|
-
phone,
|
|
84
|
-
channel,
|
|
85
|
-
subchannel,
|
|
86
|
-
bankCode,
|
|
87
|
-
bankAccount,
|
|
88
|
-
holderName,
|
|
89
|
-
branch,
|
|
90
|
-
branchCode,
|
|
91
|
-
affiliateCode,
|
|
92
|
-
} = event.data
|
|
75
|
+
const { email, username, nick_name, password, countryCode, phone, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } =
|
|
76
|
+
event.data
|
|
93
77
|
return {
|
|
94
78
|
signUpData: {
|
|
95
79
|
provider: 'local',
|
|
@@ -106,26 +90,10 @@ export default function (request) {
|
|
|
106
90
|
branchCode,
|
|
107
91
|
affiliateCode,
|
|
108
92
|
},
|
|
109
|
-
channel,
|
|
110
|
-
subchannel,
|
|
111
93
|
}
|
|
112
94
|
}),
|
|
113
95
|
setSignUpPhone: assign((context, event) => {
|
|
114
|
-
const {
|
|
115
|
-
email,
|
|
116
|
-
countryCode,
|
|
117
|
-
phone,
|
|
118
|
-
nick_name,
|
|
119
|
-
password,
|
|
120
|
-
channel,
|
|
121
|
-
subchannel,
|
|
122
|
-
bankCode,
|
|
123
|
-
bankAccount,
|
|
124
|
-
holderName,
|
|
125
|
-
branch,
|
|
126
|
-
branchCode,
|
|
127
|
-
affiliateCode,
|
|
128
|
-
} = event.data
|
|
96
|
+
const { email, countryCode, phone, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
|
|
129
97
|
return {
|
|
130
98
|
signUpData: {
|
|
131
99
|
provider: 'phone',
|
|
@@ -141,26 +109,10 @@ export default function (request) {
|
|
|
141
109
|
branchCode,
|
|
142
110
|
affiliateCode,
|
|
143
111
|
},
|
|
144
|
-
channel,
|
|
145
|
-
subchannel,
|
|
146
112
|
}
|
|
147
113
|
}),
|
|
148
114
|
setSignUpEmail: assign((context, event) => {
|
|
149
|
-
const {
|
|
150
|
-
email,
|
|
151
|
-
nick_name,
|
|
152
|
-
password,
|
|
153
|
-
channel,
|
|
154
|
-
subchannel,
|
|
155
|
-
bankCode,
|
|
156
|
-
bankAccount,
|
|
157
|
-
holderName,
|
|
158
|
-
branch,
|
|
159
|
-
branchCode,
|
|
160
|
-
affiliateCode,
|
|
161
|
-
countryCode,
|
|
162
|
-
phone,
|
|
163
|
-
} = event.data
|
|
115
|
+
const { email, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, countryCode, phone } = event.data
|
|
164
116
|
return {
|
|
165
117
|
signUpData: {
|
|
166
118
|
provider: 'email',
|
|
@@ -176,12 +128,10 @@ export default function (request) {
|
|
|
176
128
|
countryCode,
|
|
177
129
|
phone,
|
|
178
130
|
},
|
|
179
|
-
channel,
|
|
180
|
-
subchannel,
|
|
181
131
|
}
|
|
182
132
|
}),
|
|
183
133
|
setRegistrationData: assign((context, event) => {
|
|
184
|
-
const { account, currency, site, strategy, uid
|
|
134
|
+
const { account, currency, site, strategy, uid } = event.data
|
|
185
135
|
return {
|
|
186
136
|
registrationData: {
|
|
187
137
|
account,
|
|
@@ -189,8 +139,6 @@ export default function (request) {
|
|
|
189
139
|
site,
|
|
190
140
|
strategy,
|
|
191
141
|
uid,
|
|
192
|
-
channel,
|
|
193
|
-
sub_channel,
|
|
194
142
|
},
|
|
195
143
|
}
|
|
196
144
|
}),
|
|
@@ -202,30 +150,24 @@ export default function (request) {
|
|
|
202
150
|
},
|
|
203
151
|
services: {
|
|
204
152
|
authenticate: async (context, event) => {
|
|
205
|
-
const {
|
|
153
|
+
const { signUpData, deviceTokenEnable } = context
|
|
206
154
|
const dt = deviceTokenEnable ? await request.config.getDt?.() : undefined
|
|
207
155
|
|
|
208
156
|
const affiliateCode = storage.get('ac') || signUpData?.affiliateCode
|
|
209
157
|
const messages = {
|
|
210
158
|
url: window.location.href,
|
|
211
|
-
channelOrders: [
|
|
212
|
-
{ channel: storage.get('channel'), subchannel: storage.get('subchannel') },
|
|
213
|
-
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
214
|
-
{ channel: channel, subchannel: subchannel },
|
|
215
|
-
],
|
|
216
159
|
affiliateCode,
|
|
217
160
|
}
|
|
218
161
|
|
|
219
|
-
|
|
162
|
+
// 因 client-pwa-cash PR #805 的問題,暫時註解此 Sentry 上報
|
|
163
|
+
// https://github.com/jetthai/client-pwa-cash/pull/805
|
|
164
|
+
// sentry?.captureMessage(`[SignUp] Authenticate Data: ${JSON.stringify(messages)}`, { level: 'info' })
|
|
220
165
|
|
|
221
166
|
const referralObj = {}
|
|
222
167
|
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
|
223
168
|
referralObj.ac = affiliateCode
|
|
224
169
|
}
|
|
225
170
|
|
|
226
|
-
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
227
|
-
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
228
|
-
|
|
229
171
|
return await request.send(
|
|
230
172
|
auth.register({
|
|
231
173
|
...signUpData,
|