module HttpBasicAuthentication::Patches::AccountControllerPatch

This module overwrites the default behavior of the AccountController by disabling most of its methods as they make no sense in combination with the implicit user generation used by this plugin

Public Instance Methods

activate_with_http_basic() click to toggle source
# File lib/http_basic_authentication/patches/account_controller_patch.rb, line 40
def activate_with_http_basic
  not_available!
end
activation_email_with_http_basic() click to toggle source
# File lib/http_basic_authentication/patches/account_controller_patch.rb, line 44
def activation_email_with_http_basic
  not_available!
end
login_with_http_basic() click to toggle source
# File lib/http_basic_authentication/patches/account_controller_patch.rb, line 18
def login_with_http_basic
  not_available!
end
logout_with_http_basic() click to toggle source

If the user was fully logged in only present a simple text stating to logout by closing the browser

# File lib/http_basic_authentication/patches/account_controller_patch.rb, line 24
def logout_with_http_basic
  if User.current.anonymous?
    redirect_to home_url
  elsif request.post?
    render "http_basic_authentication/logout"
  end
end
lost_password_with_http_basic() click to toggle source
# File lib/http_basic_authentication/patches/account_controller_patch.rb, line 32
def lost_password_with_http_basic
  not_available!
end
register_with_http_basic() click to toggle source
# File lib/http_basic_authentication/patches/account_controller_patch.rb, line 36
def register_with_http_basic
  not_available!
end

Private Instance Methods

not_available!() click to toggle source
# File lib/http_basic_authentication/patches/account_controller_patch.rb, line 50
def not_available!
  render text: "Method Not Allowed", status: 405
end