If you are authenticating user on your own call this method - hobo will remember signed-in user this way. Arguments: user - user that you want to sign in options - hash with messages (:success_notice, :redirect_to) block - (optional) will be called after assigning current_user
# File lib/hobo/controller/user_base.rb, line 163 def sign_user_in(user, options={}, &block) options.reverse_merge!(:success_notice => ht(:"#{model.to_s.underscore}.messages.login.success", :default=>["You have logged in."])) old_user = current_user self.current_user = user if block_given? unless yield self.current_user = nil return end end if !user.account_active? # account not activate - cancel this login self.current_user = old_user unless performed? respond_to do |wants| wants.html {render :action => :account_disabled} wants.js {hobo_ajax_response} end end else if params[:remember_me].present? current_user.remember_me create_auth_cookie end flash[:notice] ||= options[:success_notice] unless performed? respond_to do |wants| wants.html {redirect_back_or_default(options[:redirect_to] || home_page) } wants.js {hobo_ajax_response} end end end end
# File lib/hobo/controller/user_base.rb, line 6 def included(base) base.class_eval do extend ClassMethods class << self alias_method_chain :available_auto_actions, :user_actions alias_method_chain :def_auto_actions, :user_actions end skip_before_filter :login_required, :only => [:login, :signup, :do_signup, :forgot_password, :reset_password, :do_reset_password, :accept_invitation, :do_accept_invitation] alias_method_chain :hobo_update, :account_flash end end