Mandate email validation for free accounts. Be sure to set EMAIL_VALIDATION_CUTOFF_DATE before deploy

This commit is contained in:
Kyle Drake 2016-05-13 16:48:29 -04:00
parent cef1611003
commit a2a6a40438
19 changed files with 178 additions and 27 deletions

2
app.rb
View file

@ -29,6 +29,8 @@ before do
content_type :json
elsif request.path.match /^\/webhooks\//
# Skips the CSRF check for stripe web hooks
elsif email_not_validated? && !(request.path =~ /^\/site\/.+\/confirm_email|^\/settings\/change_email|^\/signout|^\/welcome|^\/plan/)
redirect "/site/#{current_site.username}/confirm_email"
else
content_type :html, 'charset' => 'utf-8'
redirect '/' if request.post? && !csrf_safe?