@jetthai/cuora 1.1.452 → 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 +6 -0
- package/package.json +1 -1
- package/src/machine/auth_otp_v3.js +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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
|
+
|
|
5
11
|
### [1.1.452](https://github.com/jetthai/cuora-module/compare/v1.1.451...v1.1.452) (2026-07-28)
|
|
6
12
|
|
|
7
13
|
### [1.1.451](https://github.com/jetthai/cuora-module/compare/v1.1.450...v1.1.451) (2026-07-21)
|
package/package.json
CHANGED
|
@@ -217,18 +217,25 @@ export default function (request) {
|
|
|
217
217
|
},
|
|
218
218
|
guards: {
|
|
219
219
|
isVerified: (context, event) => {
|
|
220
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
238
|
+
return strategy === 'email' && !!userInfo && !userInfo.email_verification_status && !userInfo.email
|
|
232
239
|
},
|
|
233
240
|
hasNoPhone: (context, event) => {
|
|
234
241
|
const { error } = context
|