10 minutes for request resend OTP, 20 minutes for expired

This commit is contained in:
Ibnu Maksum
2024-08-17 11:18:30 +07:00
parent 5070cd9ed7
commit 5242b19f6f
2 changed files with 4 additions and 4 deletions

View File

@ -153,8 +153,8 @@ switch ($action) {
$phoneFile = $otpPath . sha1($username . $db_pass) . "_phone.txt";
// expired 10 minutes
if (file_exists($otpFile) && time() - filemtime($otpFile) < 1200) {
r2(U . 'accounts/phone-update', 'e', Lang::T('Please wait ' . (1200 - (time() - filemtime($otpFile))) . ' seconds before sending another SMS'));
if (file_exists($otpFile) && time() - filemtime($otpFile) < 600) {
r2(U . 'accounts/phone-update', 'e', Lang::T('Please wait ' . (600 - (time() - filemtime($otpFile))) . ' seconds before sending another SMS'));
} else {
$otp = rand(100000, 999999);
file_put_contents($otpFile, $otp);