mirror of
https://github.com/neocities/neocities.git
synced 2025-08-06 09:34:57 +02:00
code input validation, lockout after 3 attempts
This commit is contained in:
parent
40e848e2c0
commit
7f05c2c9dc
3 changed files with 41 additions and 4 deletions
|
@ -329,6 +329,13 @@ post '/site/:username/confirm_phone' do
|
|||
end
|
||||
|
||||
current_site.phone_verification_sent_at = Time.now
|
||||
current_site.phone_verification_attempts += 1
|
||||
|
||||
if current_site.phone_verification_attempts > Site::PHONE_VERIFICATION_LOCKOUT_ATTEMPTS
|
||||
flash[:error] = 'You have exceeded the number of phone verification attempts allowed.'
|
||||
redirect "/site/#{current_site.username}/confirm_phone"
|
||||
end
|
||||
|
||||
current_site.save_changes validate: false
|
||||
|
||||
verification = $twilio.verify
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue