@jetthai/cuora 1.1.451 → 1.1.453

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 CHANGED
@@ -2,6 +2,14 @@
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.453](https://github.com/jetthai/cuora-module/compare/v1.1.452...v1.1.453) (2026-07-28)
6
+
7
+ ### Features
8
+
9
+ - **otp:** 重構 OTP 驗證支援 Phone + Email 雙驗證點 ([a9c8eb3](https://github.com/jetthai/cuora-module/commit/a9c8eb32b221804ea4e934981f0e455c1d5e7b66))
10
+
11
+ ### [1.1.452](https://github.com/jetthai/cuora-module/compare/v1.1.451...v1.1.452) (2026-07-28)
12
+
5
13
  ### [1.1.451](https://github.com/jetthai/cuora-module/compare/v1.1.450...v1.1.451) (2026-07-21)
6
14
 
7
15
  ### [1.1.450](https://github.com/jetthai/cuora-module/compare/v1.1.449...v1.1.450) (2026-07-21)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.451",
3
+ "version": "1.1.453",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -217,18 +217,25 @@ export default function (request) {
217
217
  },
218
218
  guards: {
219
219
  isVerified: (context, event) => {
220
- return context.userInfo?.verification_status === 1
220
+ const { strategy, userInfo } = context
221
+ if (strategy === 'phone') return !!userInfo?.phone_verification_status
222
+ if (strategy === 'email') return !!userInfo?.email_verification_status
223
+ return false
221
224
  },
222
225
  isNotVerified: (context, event) => {
223
- return context.userInfo && context.userInfo.verification_status !== 1
226
+ const { strategy, userInfo } = context
227
+ if (!userInfo) return false
228
+ if (strategy === 'phone') return !userInfo.phone_verification_status
229
+ if (strategy === 'email') return !userInfo.email_verification_status
230
+ return false
224
231
  },
225
232
  isPhoneNotVerified: (context, event) => {
226
233
  const { strategy, userInfo } = context
227
- return strategy === 'phone' && userInfo && userInfo.verification_status !== 1 && !userInfo.phone
234
+ return strategy === 'phone' && !!userInfo && !userInfo.phone_verification_status && !userInfo.phone
228
235
  },
229
236
  isEmailNotVerified: (context, event) => {
230
237
  const { strategy, userInfo } = context
231
- return strategy === 'email' && userInfo && userInfo.verification_status !== 1 && !userInfo.email
238
+ return strategy === 'email' && !!userInfo && !userInfo.email_verification_status && !userInfo.email
232
239
  },
233
240
  hasNoPhone: (context, event) => {
234
241
  const { error } = context
@@ -86,12 +86,26 @@ export default function (request) {
86
86
  return { fc }
87
87
  }),
88
88
  setSignUpId: assign((context, event) => {
89
- const { email, username, nick_name, password, countryCode, phone, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } =
90
- event.data
89
+ const {
90
+ email,
91
+ username,
92
+ nick_name,
93
+ password,
94
+ countryCode,
95
+ phone,
96
+ bankCode,
97
+ bankAccount,
98
+ holderName,
99
+ branch,
100
+ branchCode,
101
+ affiliateCode,
102
+ birthday,
103
+ } = event.data
91
104
  return {
92
105
  signUpData: {
93
106
  provider: 'local',
94
107
  ...pickBindData(event.data),
108
+ birthday,
95
109
  email,
96
110
  username,
97
111
  nick_name,
@@ -108,11 +122,13 @@ export default function (request) {
108
122
  }
109
123
  }),
110
124
  setSignUpPhone: assign((context, event) => {
111
- const { email, countryCode, phone, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
125
+ const { email, countryCode, phone, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, birthday } =
126
+ event.data
112
127
  return {
113
128
  signUpData: {
114
129
  provider: 'phone',
115
130
  ...pickBindData(event.data),
131
+ birthday,
116
132
  email,
117
133
  countryCode,
118
134
  phone,
@@ -128,11 +144,13 @@ export default function (request) {
128
144
  }
129
145
  }),
130
146
  setSignUpEmail: assign((context, event) => {
131
- const { email, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, countryCode, phone } = event.data
147
+ const { email, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, countryCode, phone, birthday } =
148
+ event.data
132
149
  return {
133
150
  signUpData: {
134
151
  provider: 'email',
135
152
  ...pickBindData(event.data),
153
+ birthday,
136
154
  email,
137
155
  nick_name,
138
156
  password,
@@ -1,85 +0,0 @@
1
- # JT-1776243420: Third-Party Register Carry Phone / Email Payload
2
-
3
- ## Key Changes
4
-
5
- 1. Extended third-party redirect payload assembly to read `tp_phone`, `tp_countryCode`, and `tp_email` from storage.
6
- 2. Preserved existing affiliate code / nickname behavior and appended new fields only when values are valid.
7
- 3. Cleans the temporary third-party storage keys after composing the redirect query.
8
-
9
- ---
10
-
11
- ## Key Findings
12
-
13
- ### Strengths
14
-
15
- 1. The change is tightly scoped to the third-party auth redirect builder in `src/machine/auth.js:477-520`.
16
- 2. Existing affiliate code and nickname logic remains unchanged while phone / email are additive only.
17
- 3. Temporary keys are removed after payload composition, reducing leakage into later unrelated auth flows.
18
-
19
- ---
20
-
21
- ### Behavior Observed
22
-
23
- 1. Static review confirms `phone`, `countryCode`, and `email` are appended only when storage values are not `undefined` / `null`.
24
- 2. Channel and subchannel fallback logic stays intact after the new fields are added.
25
- 3. No unrelated file changes were present in this repo for the review scope.
26
-
27
- ---
28
-
29
- ## 🔧 Change Type
30
-
31
- - [ ] 🐛 Bug fix
32
- - [x] ✨ New feature
33
- - [ ] 💄 Style
34
- - [ ] ♻️ Refactor
35
- - [ ] ⚡ Performance
36
- - [ ] 🔧 Chore
37
-
38
- ---
39
-
40
- ## 📱 Impact Scope
41
-
42
- - Third-party register / login redirect query assembly in cuora shared auth machine.
43
- - Downstream PWA clients that store `tp_phone`, `tp_countryCode`, and `tp_email` before `LOGIN_3PARTY`.
44
-
45
- ---
46
-
47
- ## Test Completion Status
48
-
49
- | Item | Validation Tested | Status |
50
- | -------------------------- | --------------------------------------------------------------------- | ------- |
51
- | Diff hygiene | `git diff --check` in `cuora-module` | PASS |
52
- | Shared auth payload review | Reviewed `src/machine/auth.js:477-520` against ticket intent | PASS |
53
- | Runtime redirect execution | Not run in this repo directly; validated through client repos instead | NOT RUN |
54
-
55
- ---
56
-
57
- ## 📋 Spec Validation (Aligned with review-playbook)
58
-
59
- | Spec Item | Evidence (File/Line/Result) | Status |
60
- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------ |
61
- | Third-party flow can carry phone when client stored it | `src/machine/auth.js:479-520` reads `tp_phone` / `tp_countryCode` and appends them to `referralObj` | PASS |
62
- | Third-party flow can carry email when client stored it | `src/machine/auth.js:481-520` reads `tp_email` and appends it to `referralObj` | PASS |
63
- | Affiliate code and nickname keep original logic | `src/machine/auth.js:477-500` keeps `ac` / `nick_name` handling unchanged | PASS |
64
- | Temporary third-party data does not leak into later unrelated flows | `src/machine/auth.js:518-520` removes the temporary storage keys after composing the redirect URL | PASS |
65
-
66
- ---
67
-
68
- ## 📋 Standards Checklist (Summary)
69
-
70
- | Category | Result | Notes |
71
- | ---------------------- | ------- | --------------------------------------------------------------------------- |
72
- | Memory Safety | PASS | Simple storage reads and object assembly only. |
73
- | Rendering Performance | PASS | No rendering code touched. |
74
- | Network Requests | PASS | Existing redirect flow only; no extra requests added. |
75
- | Bundle Optimization | PASS | No new imports or heavy logic added. |
76
- | Code Quality | PASS | Scope is narrow and branch contains only the required file change. |
77
- | Vue / Nuxt Standards | NOT RUN | Shared module; not a Vue / Nuxt surface. |
78
- | SSR Security Standards | PASS | Query parameters are assembled from existing client-side storage path only. |
79
- | Project Conventions | PASS | Matches existing storage-guard pattern used for affiliate / nickname. |
80
-
81
- ## Conclusion
82
-
83
- This repo’s shared auth-machine change matches the ticket intent and is internally consistent. Runtime behavior was not executed in `cuora-module` directly, but both client repos now pass the new storage keys into this shared payload path.
84
-
85
- **Overall Result:** PASS (PARTIAL)