@jetthai/cuora 1.1.463-dev.0 → 1.1.463-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 +2 -0
- package/package.json +1 -1
- package/src/machine/auth.js +21 -38
- package/src/machine/user_sign_up.js +3 -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.463-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.0...v1.1.463-dev.1) (2026-08-13)
|
|
6
|
+
|
|
5
7
|
### [1.1.463-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.463-dev.0) (2026-08-13)
|
|
6
8
|
|
|
7
9
|
### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.8) (2026-08-09)
|
package/package.json
CHANGED
package/src/machine/auth.js
CHANGED
|
@@ -475,8 +475,8 @@ export default function (request) {
|
|
|
475
475
|
const hasExplicitAc = !!event.data && Object.prototype.hasOwnProperty.call(event.data, 'ac')
|
|
476
476
|
const acRead = readParamFromLocation(AC_KEYS)
|
|
477
477
|
const affiliateCode = hasExplicitAc ? normalize(event.data.ac) : acRead.value
|
|
478
|
-
//
|
|
479
|
-
const friendCode = fc || readParamFromLocation(FC_KEYS).value
|
|
478
|
+
// 宿主可能傳進字面 'undefined',先 normalize 才不會蓋掉網址/儲存層的真值
|
|
479
|
+
const friendCode = normalize(fc) || readParamFromLocation(FC_KEYS).value
|
|
480
480
|
|
|
481
481
|
// 本段結尾以 window.location.href 離站,離站後 SPA 記憶體全丟;導頁前先落地雙寫
|
|
482
482
|
writeParam('ac', affiliateCode, { sentry })
|
|
@@ -496,30 +496,24 @@ export default function (request) {
|
|
|
496
496
|
|
|
497
497
|
sentry?.captureMessage(`[Auth] RedirectTo3Party Data: ${JSON.stringify(messages)}`, { level: 'info' })
|
|
498
498
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
referralObj.email = email
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
if (![undefined, 'undefined', null, 'null'].includes(birthday)) {
|
|
521
|
-
referralObj.birthday = birthday
|
|
522
|
-
}
|
|
499
|
+
// 空值一律不進 query。dt 與 fc 原本裸展開進 URLSearchParams,兩者為 undefined 時會被
|
|
500
|
+
// 序列化成字面字串 dt=undefined / fc=undefined,後端收到的是 "undefined" 而非缺省
|
|
501
|
+
const query = pickBy(
|
|
502
|
+
{
|
|
503
|
+
provider,
|
|
504
|
+
redirectURI: `${window.location.protocol}//${window.location.host}${context.base}`,
|
|
505
|
+
ac: affiliateCode,
|
|
506
|
+
nick_name: nickname,
|
|
507
|
+
phone,
|
|
508
|
+
countryCode,
|
|
509
|
+
email,
|
|
510
|
+
birthday,
|
|
511
|
+
dt,
|
|
512
|
+
platform: 'pwa',
|
|
513
|
+
fc: friendCode,
|
|
514
|
+
},
|
|
515
|
+
(value) => normalize(value) !== null
|
|
516
|
+
)
|
|
523
517
|
|
|
524
518
|
storage.remove('tp_phone')
|
|
525
519
|
storage.remove('tp_countryCode')
|
|
@@ -528,18 +522,7 @@ export default function (request) {
|
|
|
528
522
|
|
|
529
523
|
const fullURL = request.config.fullURL
|
|
530
524
|
|
|
531
|
-
const redirectURL = urljoin(
|
|
532
|
-
fullURL,
|
|
533
|
-
'login?' +
|
|
534
|
-
new URLSearchParams({
|
|
535
|
-
provider,
|
|
536
|
-
redirectURI: `${window.location.protocol}//${window.location.host}${context.base}`,
|
|
537
|
-
...referralObj,
|
|
538
|
-
dt,
|
|
539
|
-
platform: 'pwa',
|
|
540
|
-
fc: friendCode,
|
|
541
|
-
}).toString()
|
|
542
|
-
)
|
|
525
|
+
const redirectURL = urljoin(fullURL, 'login?' + new URLSearchParams(query).toString())
|
|
543
526
|
|
|
544
527
|
window.location.href = redirectURL
|
|
545
528
|
},
|
|
@@ -84,7 +84,8 @@ export default function (request) {
|
|
|
84
84
|
}),
|
|
85
85
|
setFriendCode: assign((context, event) => {
|
|
86
86
|
const { fc } = event.data
|
|
87
|
-
|
|
87
|
+
// api/auth.js 的 register 只濾 undefined/null,字面 'undefined' 會直送 query string
|
|
88
|
+
return { fc: normalize(fc) }
|
|
88
89
|
}),
|
|
89
90
|
setSignUpId: assign((context, event) => {
|
|
90
91
|
const {
|
|
@@ -222,7 +223,7 @@ export default function (request) {
|
|
|
222
223
|
...referralObj,
|
|
223
224
|
dt,
|
|
224
225
|
reCaptchaToken: context.reCaptchaToken,
|
|
225
|
-
fc: context.fc || readParamFromLocation(FC_KEYS).value
|
|
226
|
+
fc: context.fc || readParamFromLocation(FC_KEYS).value,
|
|
226
227
|
})
|
|
227
228
|
)
|
|
228
229
|
},
|