{"id":4826,"date":"2025-11-05T09:43:41","date_gmt":"2025-11-05T06:13:41","guid":{"rendered":"https:\/\/vatamam.com\/blog\/?page_id=4826"},"modified":"2025-11-05T09:44:16","modified_gmt":"2025-11-05T06:14:16","slug":"password-recovery","status":"publish","type":"page","link":"https:\/\/vatamam.com\/blog\/password-recovery\/","title":{"rendered":"\u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0631\u0645\u0632 \u0639\u0628\u0648\u0631"},"content":{"rendered":"<div class=\"vt-auth-page\" id=\"vt-recovery\">\n  <div class=\"vt-auth-card\">\n    <div class=\"vt-auth-header\">\n      <div class=\"vt-brand-circle\">\ud83d\udd11<\/div>\n      <h1>\u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0631\u0645\u0632 \u0639\u0628\u0648\u0631<\/h1>\n      <p>\u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u062b\u0628\u062a\u200c\u0634\u062f\u0647 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f \u0648 \u0631\u0645\u0632 \u062c\u062f\u06cc\u062f \u0628\u0633\u0627\u0632\u06cc\u062f.<\/p>\n    <\/div>\n\n    <div class=\"vt-auth-body\">\n      <div class=\"vt-auth-progress\" aria-label=\"\u0645\u0631\u0627\u062d\u0644 \u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0631\u0645\u0632 \u0639\u0628\u0648\u0631\">\n        <div class=\"vt-ap-dot active\" id=\"rpd1\">\u06f1<\/div>\n        <div class=\"vt-ap-line\" id=\"rpl1\"><\/div>\n        <div class=\"vt-ap-dot\" id=\"rpd2\">\u06f2<\/div>\n        <div class=\"vt-ap-line\" id=\"rpl2\"><\/div>\n        <div class=\"vt-ap-dot\" id=\"rpd3\">\u06f3<\/div>\n      <\/div>\n\n      <div class=\"vt-alert\" id=\"rec-alert\" role=\"alert\"><\/div>\n\n      <div class=\"vt-auth-step active\" id=\"rec-s1\">\n        <div class=\"vt-f\">\n          <label for=\"rec-phone\"><span class=\"ico\">\ud83d\udcf1<\/span>\u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u062b\u0628\u062a\u200c\u0634\u062f\u0647<\/label>\n          <div class=\"vt-input-row\">\n            <input class=\"vt-input\" id=\"rec-phone\" type=\"tel\" placeholder=\"09xxxxxxxxx\" maxlength=\"11\" inputmode=\"numeric\" autocomplete=\"tel\">\n            <button type=\"button\" class=\"vt-send-btn\" id=\"rec-send-btn\">\u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u062f<\/button>\n          <\/div>\n        <\/div>\n      <\/div>\n\n      <div class=\"vt-auth-step\" id=\"rec-s2\">\n        <p class=\"vt-otp-hint\">\u06a9\u062f \u06f6 \u0631\u0642\u0645\u06cc \u0627\u0631\u0633\u0627\u0644\u200c\u0634\u062f\u0647 \u0628\u0647 <span class=\"ph\" id=\"rec-phone-show\"><\/span><\/p>\n        <div class=\"vt-otp-boxes\" id=\"rec-otp-boxes\" dir=\"ltr\">\n          <input class=\"vt-otp-box\" aria-label=\"\u0631\u0642\u0645 \u0627\u0648\u0644\"><input class=\"vt-otp-box\" aria-label=\"\u0631\u0642\u0645 \u062f\u0648\u0645\"><input class=\"vt-otp-box\" aria-label=\"\u0631\u0642\u0645 \u0633\u0648\u0645\">\n          <span class=\"vt-otp-sep\">\u2014<\/span>\n          <input class=\"vt-otp-box\" aria-label=\"\u0631\u0642\u0645 \u0686\u0647\u0627\u0631\u0645\"><input class=\"vt-otp-box\" aria-label=\"\u0631\u0642\u0645 \u067e\u0646\u062c\u0645\"><input class=\"vt-otp-box\" aria-label=\"\u0631\u0642\u0645 \u0634\u0634\u0645\">\n        <\/div>\n        <div class=\"vt-otp-footer\">\n          <span class=\"vt-timer\" id=\"rec-timer\">\u06f0\u06f2:\u06f0\u06f0<\/span>\n          <button type=\"button\" class=\"vt-resend\" id=\"rec-resend\" disabled>\u0627\u0631\u0633\u0627\u0644 \u0645\u062c\u062f\u062f<\/button>\n          <button type=\"button\" class=\"vt-back-btn\" id=\"rec-back\">\u062a\u063a\u06cc\u06cc\u0631 \u0634\u0645\u0627\u0631\u0647<\/button>\n        <\/div>\n        <button type=\"button\" class=\"vt-btn\" id=\"rec-verify-btn\">\u062a\u0623\u06cc\u06cc\u062f \u06a9\u062f<\/button>\n      <\/div>\n\n      <div class=\"vt-auth-step\" id=\"rec-s3\">\n        <div class=\"vt-f\">\n          <label for=\"rec-pw\"><span class=\"ico\">\ud83d\udd12<\/span>\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u062c\u062f\u06cc\u062f<\/label>\n          <div class=\"vt-pw-wrap\">\n            <input class=\"vt-input\" id=\"rec-pw\" type=\"password\" placeholder=\"\u062d\u062f\u0627\u0642\u0644 \u06f6 \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631\" autocomplete=\"new-password\">\n            <button type=\"button\" class=\"vt-pw-eye\" onclick=\"vtPW('rec-pw',this)\" aria-label=\"\u0646\u0645\u0627\u06cc\u0634 \u0631\u0645\u0632\"><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"display:inline-block;vertical-align:middle;flex-shrink:0;\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"\/><circle cx=\"12\" cy=\"12\" r=\"3\"\/><\/svg><\/button>\n          <\/div>\n          <div class=\"vt-pw-bar\"><div class=\"vt-pw-fill\" id=\"rec-pw-fill\"><\/div><\/div>\n        <\/div>\n        <div class=\"vt-f\">\n          <label for=\"rec-pw2\"><span class=\"ico\">\ud83d\udd12<\/span>\u062a\u06a9\u0631\u0627\u0631 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u062c\u062f\u06cc\u062f<\/label>\n          <div class=\"vt-pw-wrap\">\n            <input class=\"vt-input\" id=\"rec-pw2\" type=\"password\" placeholder=\"\u062a\u06a9\u0631\u0627\u0631 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631\" autocomplete=\"new-password\">\n            <button type=\"button\" class=\"vt-pw-eye\" onclick=\"vtPW('rec-pw2',this)\" aria-label=\"\u0646\u0645\u0627\u06cc\u0634 \u0631\u0645\u0632\"><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"display:inline-block;vertical-align:middle;flex-shrink:0;\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"\/><circle cx=\"12\" cy=\"12\" r=\"3\"\/><\/svg><\/button>\n          <\/div>\n        <\/div>\n        <button type=\"button\" class=\"vt-btn\" id=\"rec-submit-btn\">\u0630\u062e\u06cc\u0631\u0647 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u062c\u062f\u06cc\u062f<\/button>\n      <\/div>\n    <\/div>\n\n    <div class=\"vt-auth-footer\">\n      \u0631\u0645\u0632 \u062e\u0648\u062f \u0631\u0627 \u0628\u0647 \u062e\u0627\u0637\u0631 \u0622\u0648\u0631\u062f\u06cc\u062f\u061f      <a href=\"https:\/\/vatamam.com\/blog\/customer-login\/\">\u0648\u0631\u0648\u062f \u0628\u0647 \u062d\u0633\u0627\u0628<\/a>\n    <\/div>\n  <\/div>\n<\/div>\n\n<script>\n\/\/ Inline VatamamOTP fallback\nif(typeof VatamamOTP==='undefined'){window.VatamamOTP=(function(){function g(b){return b.map(function(x){return x.value;}).join('');}function init(c,cb){if(!c)return null;var b=Array.from(c.querySelectorAll('.vt-otp-box'));if(!b.length)return null;c.style.direction='ltr';b.forEach(function(x,i){x.setAttribute('type','tel');x.setAttribute('inputmode','numeric');x.setAttribute('maxlength','1');x.addEventListener('keydown',function(e){if(e.key==='Backspace'){if(this.value)this.value='';else if(i>0){b[i-1].focus();b[i-1].value='';}e.preventDefault();}else if(!\/^[0-9]$\/.test(e.key)&&e.key!=='Tab')e.preventDefault();});x.addEventListener('input',function(){var v=this.value.replace(\/[^0-9]\/g,'');this.value=v?v[v.length-1]:'';if(this.value&&i<b.length-1){b[i+1].focus();b[i+1].select();}var code=g(b);if(code.length===b.length&&cb)cb(code);});x.addEventListener('focus',function(){this.select();});x.addEventListener('paste',function(e){e.preventDefault();var p=(e.clipboardData||window.clipboardData).getData('text').replace(\/[^0-9]\/g,'');b.forEach(function(a,j){a.value=p[j]||'';});var last=Math.min(p.length,b.length)-1;if(last>=0)b[last].focus();var code=g(b);if(code.length===b.length&&cb)cb(code);});});return{getCode:function(){return g(b);},clear:function(){b.forEach(function(x){x.value='';});if(b[0])b[0].focus();},focus:function(){if(b[0])b[0].focus();}};}return{init:init};})();}\n(function(){\n  var AJAX='https:\/\/vatamam.com\/blog\/wp-admin\/admin-ajax.php',NOTP='9d756e0c44';\n  var phone='',otp=null,timer=null,secs=120,verified_code='';\n\n  function prog(step){\n    for(var i=1;i<=3;i++){\n      var d=document.getElementById('rpd'+i);\n      d.classList.remove('active','done');\n      if(i<step) d.classList.add('done'); else if(i===step) d.classList.add('active');\n    }\n    for(var j=1;j<=2;j++) document.getElementById('rpl'+j).classList.toggle('done',j<step);\n    for(var k=1;k<=3;k++) document.getElementById('rec-s'+k).classList.toggle('active',k===step);\n  }\n  function alrt(msg,type){\n    var e=document.getElementById('rec-alert');\n    if(!msg){e.style.display='none';return;}\n    e.className='vt-alert '+(type||'err');e.innerHTML=msg;e.style.display='block';\n    e.scrollIntoView({behavior:'smooth',block:'nearest'});\n  }\n  function post(d,cb){\n    var f=new FormData();Object.keys(d).forEach(function(k){f.append(k,d[k]);});\n    fetch(AJAX,{method:'POST',body:f}).then(function(r){return r.json();}).then(cb)\n    .catch(function(){alrt('\u062e\u0637\u0627 \u062f\u0631 \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627 \u0633\u0631\u0648\u0631','err');});\n  }\n  function startTimer(){\n    secs=120;clearInterval(timer);\n    document.getElementById('rec-resend').disabled=true;\n    tick();timer=setInterval(tick,1000);\n  }\n  function tick(){\n    secs--;\n    var m=Math.floor(secs\/60),s=secs%60;\n    document.getElementById('rec-timer').textContent=(m<10?'0'+m:m)+':'+(s<10?'0'+s:s);\n    if(secs<=0){clearInterval(timer);document.getElementById('rec-timer').textContent='\u0645\u0646\u0642\u0636\u06cc';document.getElementById('rec-resend').disabled=false;}\n  }\n\n  \/\/ Init OTP \u2014 \u0628\u0627 \u0635\u0628\u0631 \u0628\u0631\u0627\u06cc \u0644\u0648\u062f \u0634\u062f\u0646 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\n  function initOTP(){\n    var container=document.getElementById('rec-otp-boxes');\n    if(!container) return;\n    container.style.direction='ltr';\n    if(typeof VatamamOTP!=='undefined'){\n      otp=VatamamOTP.init(container,function(code){\n        if(code.length===6) document.getElementById('rec-verify-btn').click();\n      });\n    } else {\n      \/\/ Fallback: simple input handling\n      var boxes=Array.from(container.querySelectorAll('.vt-otp-box'));\n      boxes.forEach(function(b,i){\n        b.setAttribute('type','tel');b.setAttribute('maxlength','1');b.setAttribute('inputmode','numeric');\n        b.addEventListener('input',function(){\n          this.value=this.value.replace(\/\\D\/g,'').slice(-1);\n          if(this.value&&i<boxes.length-1) boxes[i+1].focus();\n          var code=boxes.map(function(x){return x.value;}).join('');\n          if(code.length===6) document.getElementById('rec-verify-btn').click();\n        });\n        b.addEventListener('keydown',function(e){if(e.key==='Backspace'&&!this.value&&i>0)boxes[i-1].focus();});\n      });\n      otp={\n        getCode:function(){return boxes.map(function(x){return x.value;}).join('');},\n        clear:function(){boxes.forEach(function(b){b.value='';});boxes[0].focus();},\n        focus:function(){boxes[0].focus();}\n      };\n    }\n  }\n  \/\/ Init after DOM ready\n  if(document.readyState==='loading'){\n    document.addEventListener('DOMContentLoaded',initOTP);\n  } else { initOTP(); }\n\n  \/\/ STEP 1: Send\n  document.getElementById('rec-send-btn').onclick=function(){\n    phone=document.getElementById('rec-phone').value.replace(\/\\D\/g,'');\n    if(!\/^09[0-9]{9}$\/.test(phone)){alrt('\u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0646\u0627\u0645\u0639\u062a\u0628\u0631 (\u0645\u062b\u0627\u0644: 09123456789)','err');return;}\n    var btn=this;btn.disabled=true;btn.textContent='\u0627\u0631\u0633\u0627\u0644...';\n    post({action:'antique_send_recovery_code',phone:phone,user_type:'both',nonce:NOTP},function(r){\n      if(r.success){\n        document.getElementById('rec-phone-show').textContent=phone;\n        prog(2);alrt('','');startTimer();\n        if(otp){otp.clear();otp.focus();}\n      } else alrt(r.data.message,'err');\n      btn.disabled=false;btn.textContent='\u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u062f';\n    });\n  };\n\n  \/\/ Resend\n  document.getElementById('rec-resend').onclick=function(){\n    this.disabled=true;\n    post({action:'antique_send_recovery_code',phone:phone,user_type:'both',is_resend:1,nonce:NOTP},function(r){\n      if(r.success){alrt('\u06a9\u062f \u062c\u062f\u06cc\u062f \u0627\u0631\u0633\u0627\u0644 \u0634\u062f','ok');startTimer();if(otp)otp.clear();}\n      else alrt(r.data.message,'err');\n      document.getElementById('rec-resend').disabled=false;\n    });\n  };\n\n  \/\/ Back\n  document.getElementById('rec-back').onclick=function(){clearInterval(timer);prog(1);alrt('','');};\n\n    \/\/ STEP 2: Verify \u2014 \u06a9\u062f \u062f\u0631 JS \u0646\u06af\u0647 \u062f\u0627\u0634\u062a\u0647 \u0645\u06cc\u200c\u0634\u0647\u060c \u062a\u0623\u06cc\u06cc\u062f \u0646\u0647\u0627\u06cc\u06cc \u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u06f3\n  document.getElementById('rec-verify-btn').onclick=function(){\n    var boxes=Array.from(document.querySelectorAll('#rec-otp-boxes .vt-otp-box'));\n    var code=otp?otp.getCode():boxes.map(function(b){return b.value;}).join('');\n    if(code.length<6){alrt('\u06a9\u062f \u06f6 \u0631\u0642\u0645\u06cc \u0631\u0627 \u06a9\u0627\u0645\u0644 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f','err');return;}\n    verified_code=code;\n    prog(3);alrt('','');\n    document.getElementById('rec-pw').focus();\n  };\n\n  \/\/ PW strength\n  document.getElementById('rec-pw').addEventListener('input',function(){\n    var pw=this.value,s=0;\n    if(pw.length>=6)s++;if(pw.length>=9)s++;\n    if(\/[a-z]\/.test(pw))s++;if(\/[A-Z]\/.test(pw))s++;\n    if(\/[0-9]\/.test(pw))s++;if(\/[^A-Za-z0-9]\/.test(pw))s++;\n    var cs=['','#ef4444','#f59e0b','#10b981','#059669'],ps=[0,25,55,80,100];\n    var idx=Math.min(Math.max(s,1),4);\n    var fill=document.getElementById('rec-pw-fill');\n    fill.style.width=ps[idx]+'%';fill.style.background=cs[idx];\n  });\n\n  \/\/ STEP 3: Change password\n  document.getElementById('rec-submit-btn').onclick=function(){\n    var pw=document.getElementById('rec-pw').value;\n    var pw2=document.getElementById('rec-pw2').value;\n    if(pw.length<6){alrt('\u0631\u0645\u0632 \u062d\u062f\u0627\u0642\u0644 \u06f6 \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631 \u0628\u0627\u0634\u062f','err');return;}\n    if(pw!==pw2){alrt('\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0648 \u062a\u06a9\u0631\u0627\u0631 \u0622\u0646 \u06cc\u06a9\u0633\u0627\u0646 \u0646\u06cc\u0633\u062a\u0646\u062f','err');return;}\n    var btn=this;btn.disabled=true;btn.textContent='\u0630\u062e\u06cc\u0631\u0647...';\n    \/\/ Use the stored verified code for password change\n    post({action:'antique_change_password',phone:phone,verification_code:verified_code,new_password:pw,nonce:NOTP},function(r){\n      if(r.success){\n        alrt('\u2705 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u062a\u063a\u06cc\u06cc\u0631 \u06a9\u0631\u062f! \u062f\u0631 \u062d\u0627\u0644 \u0627\u0646\u062a\u0642\u0627\u0644 \u0628\u0647 \u0635\u0641\u062d\u0647 \u0648\u0631\u0648\u062f...','ok');\n        setTimeout(function(){\n          window.location.href='https:\/\/vatamam.com\/blog\/customer-login\/';\n        },2000);\n      } else{alrt(r.data.message,'err');btn.disabled=false;btn.textContent='\ud83d\udcbe \u0630\u062e\u06cc\u0631\u0647 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u062c\u062f\u06cc\u062f';}\n    });\n  };\n})();\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_canvas","meta":{"footnotes":""},"class_list":["post-4826","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/pages\/4826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/comments?post=4826"}],"version-history":[{"count":2,"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/pages\/4826\/revisions"}],"predecessor-version":[{"id":4828,"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/pages\/4826\/revisions\/4828"}],"wp:attachment":[{"href":"https:\/\/vatamam.com\/blog\/wp-json\/wp\/v2\/media?parent=4826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}