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-3.6.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.6.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.5.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.5.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.7 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.6 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.5 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.4 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.3 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.2 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.4.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.3.4 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.3.3 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.3.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.2.1 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.2.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.1.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-3.0.0 app/helpers/adminpanel/sessions_helper.rb
adminpanel-2.6.1 app/helpers/adminpanel/sessions_helper.rb