Update auth_helper.rb

This commit is contained in:
2016-09-02 10:28:17 -04:00
committed by GitHub
parent 5a4996abac
commit 372a6a1b6a

View File

@@ -11,13 +11,8 @@
module AuthHelper
def require_user
token = CustomerToken.where("token = ? and expires_at > ?", params[:token], Time.now)
if token
#render :partial => 'issues/show', locals: {issue: Issue.find token.issue_id}, :flash => {:notice => token.issue_id}
else
if !User.current.logged?
render :file => "public/401.html.erb", :status => :unauthorized, :layout =>true
end
if !User.current.logged?
render :file => "public/401.html.erb", :status => :unauthorized, :layout =>true
end
end
end