Added better handling of record not found and invalid login tokens
This commit is contained in:
@@ -357,7 +357,12 @@ class ApplicationController < LinguaFrancaApplicationController
|
||||
end
|
||||
|
||||
def confirm(uid = nil)
|
||||
@confirmation = EmailConfirmation.find_by_token!(params[:token])
|
||||
@confirmation = EmailConfirmation.find_by_token(params[:token])
|
||||
|
||||
unless @confirmation.present?
|
||||
@token_not_found = true
|
||||
return do_404
|
||||
end
|
||||
|
||||
confirm_user = nil
|
||||
if uid.is_a?(User)
|
||||
|
||||
@@ -2064,11 +2064,16 @@ class ConferencesController < ApplicationController
|
||||
return registration_steps(registration.conference).last
|
||||
end
|
||||
|
||||
rescue_from ActiveRecord::RecordNotFound do |exception|
|
||||
do_404
|
||||
end
|
||||
|
||||
rescue_from ActiveRecord::PremissionDenied do |exception|
|
||||
if logged_in?
|
||||
redirect_to :register
|
||||
else
|
||||
@register_template = :confirm_email
|
||||
@page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details"
|
||||
render :register
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user