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