Skip to content

Commit

Permalink
fix: only add helper methods if the controller supports them
Browse files Browse the repository at this point in the history
Resolves an issue if controllers use ActionController::API instead of
ActionController::Base.

Closes #24
  • Loading branch information
adamcooke committed May 2, 2023
1 parent d52948e commit bbeca3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/authie/controller_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Authie
module ControllerExtension
class << self
def included(base)
base.helper_method :logged_in?, :current_user, :auth_session
base.helper_method :logged_in?, :current_user, :auth_session if base.respond_to?(:helper_method)

base.before_action :set_browser_id, :validate_auth_session
base.around_action :touch_auth_session

Expand Down

0 comments on commit bbeca3b

Please sign in to comment.