diff --git a/app/controllers/api/v1/registrant/confirms_controller.rb b/app/controllers/api/v1/registrant/confirms_controller.rb index b04a72449..d03e7ab93 100644 --- a/app/controllers/api/v1/registrant/confirms_controller.rb +++ b/app/controllers/api/v1/registrant/confirms_controller.rb @@ -26,11 +26,9 @@ module Api return end - render json: { - domain_name: @domain.name, - current_registrant: serialized_registrant(current_registrant), - status: params[:decision], - } + render json: { domain_name: @domain.name, + current_registrant: serialized_registrant(current_registrant), + status: params[:decision] } end private @@ -96,11 +94,13 @@ module Api end def verify_action - if params[:template] == 'change' - return true if @domain.registrant_update_confirmable?(verify_params[:token]) - elsif params[:template] == 'delete' - return true if @domain.registrant_delete_confirmable?(verify_params[:token]) - end + action = if params[:template] == 'change' + @domain.registrant_update_confirmable?(verify_params[:token]) + elsif params[:template] == 'delete' + @domain.registrant_delete_confirmable?(verify_params[:token]) + end + + return unless action render json: { error: 'Application expired or not found' }, status: :unauthorized end