From 39e7d3c0622f7b331b687cce776ddad21ef82e1a Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 19 Sep 2016 22:37:53 -0400 Subject: [PATCH] Update invoice_controller.rb --- app/controllers/invoice_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/invoice_controller.rb b/app/controllers/invoice_controller.rb index 56ad39c..0ec2f79 100644 --- a/app/controllers/invoice_controller.rb +++ b/app/controllers/invoice_controller.rb @@ -13,7 +13,11 @@ class InvoiceController < ApplicationController include AuthHelper before_filter :require_user - skip_before_filter :verify_authenticity_token, :check_if_login_required, :only => [:show] if session[:token] + skip_before_filter :verify_authenticity_token, :check_if_login_required, :only => [:show] if authorized + + def authorized + session[:token].nil? + end # # Downloads and forwards the invoice pdf