nodebb-plugin-phone-verification 2.0.0 → 2.0.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/library.js CHANGED
@@ -368,13 +368,19 @@ plugin.checkRegistration = async function (data) {
368
368
  try {
369
369
  const phoneNumber = data.req.body.phoneNumber;
370
370
  const req = data.req;
371
- const res = data.res;
371
+ // const res = data.res;
372
372
 
373
373
  if (!phoneNumber) {
374
374
  throw new Error('חובה להזין מספר טלפון');
375
375
  }
376
376
 
377
377
  const normalizedPhone = plugin.normalizePhone(phoneNumber);
378
+
379
+ const isVerified = await plugin.isPhoneVerified(normalizedPhone);
380
+ if (!isVerified) {
381
+ throw new Error('מספר הטלפון לא אומת. יש ללחוץ על "שלח לאימות" ולהזין את הקוד לפני סיום ההרשמה.');
382
+ }
383
+
378
384
  const existingUid = await plugin.findUserByPhone(normalizedPhone);
379
385
 
380
386
  if (existingUid) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-phone-verification",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "אימות מספר טלפון נייד בתהליך ההרשמה לפורום NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
package/plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "nodebb-plugin-phone-verification",
3
3
  "name": "Phone Verification",
4
4
  "description": "אימות מספר טלפון נייד בתהליך ההרשמה לפורום ובפרופיל המשתמש",
5
- "version": "2.0.0",
5
+ "version": "2.0.1",
6
6
  "library": "./library.js",
7
7
  "hooks": [
8
8
  { "hook": "filter:register.check", "method": "checkRegistration" },