vona-module-a-captcha 5.0.12 → 5.0.14
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/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BeanInfo, BeanBase, uuidv4, beanFullNameFromOnionName, deepExtend, BeanScopeBase, createBeanDecorator } from 'vona';
|
|
2
|
+
import { zodCustomError, getRandomInt } from '@cabloy/utils';
|
|
2
3
|
import { Interceptor, Aspect } from 'vona-module-a-aspect';
|
|
3
|
-
import { getRandomInt } from '@cabloy/utils';
|
|
4
4
|
import { Bean, Scope } from 'vona-module-a-bean';
|
|
5
5
|
import { CacheRedis, BeanCacheRedisBase } from 'vona-module-a-cache';
|
|
6
6
|
import { Api, v } from 'vona-module-a-openapi';
|
|
@@ -25,7 +25,7 @@ let InterceptorCaptchaVerify = (_dec$6 = Interceptor({
|
|
|
25
25
|
if (typeof captcha !== 'object') throw new Error('not found valid captcha data');
|
|
26
26
|
// verify
|
|
27
27
|
const verified = await this.bean.captcha.verify(captcha.id, captcha.token, sceneName);
|
|
28
|
-
if (!verified) throw
|
|
28
|
+
if (!verified) throw zodCustomError([bodyField], this.scope.locale.CaptchaInvalid());
|
|
29
29
|
// next
|
|
30
30
|
return next();
|
|
31
31
|
}
|