Sha256: b73f24afe8ad733d655002039ec64a90248d4e27eff5033b479ef7359711d737

Contents?: true

Size: 500 Bytes

Versions: 39

Compression:

Stored size: 500 Bytes

Contents

module Adminpanel
  module SessionsHelper

    def sign_in(user)
      cookies.signed[:remember_token] = user.remember_token
      self.current_user = user
    end

    def signed_in?
      !current_user.nil?
    end

    def current_user=(user)
      @current_user = user
    end

    def current_user
      @current_user ||= User.find_by_remember_token(cookies.signed[:remember_token])
    end

    def sign_out
      self.current_user = nil
      cookies.delete(:remember_token)
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
adminpanel-2.6.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.5.5 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.5.4 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.5.3 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.5.2 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.5.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.5.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.4.3 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.4.2 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.4.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.4.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.3.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.3.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.2.5 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.2.4 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.2.3 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.2.2 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.2.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.2.0 app/helpers/adminpanel/sessions_helper.rb