Skip to content

Commit

Permalink
Merge pull request #229 from ouranos/feature/devise
Browse files Browse the repository at this point in the history
Fix Devise #authenticate_user! signature
  • Loading branch information
ouranos authored Feb 14, 2017
2 parents 381e92f + d3d9688 commit a62a2c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/app/helpers/mno_enterprise/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module MnoEnterprise
module ApplicationHelper

def support_email
MnoEnterprise.support_email
end

# Re-implement Devise filter
# For some reasons the original Devise filter seems to ignore the
# mnoe prefix when using custom devise controllers
def authenticate_user!
def authenticate_user!(_favourite=nil, opts={})
redirect_to(new_user_session_path) unless current_user
true
end

# Redirect a signed in user to the confirmation
# lounge if unconfirmed
def redirect_to_lounge_if_unconfirmed
Expand All @@ -21,17 +21,17 @@ def redirect_to_lounge_if_unconfirmed
end
return true
end

# Redirect to signup page if user not authenticated
def authenticate_user_or_signup!
unless current_user
redirect_to new_user_registration_path
false
end

true
end

def notice_hash(notice)
return {} unless notice
# TODO: refactor
Expand Down

0 comments on commit a62a2c2

Please sign in to comment.