Sha256: 0e7bc6a95daf061e381cfcb70eaf1998fd02e17260cd1e570929f76dbc262e14
Contents?: true
Size: 725 Bytes
Versions: 20
Compression:
Stored size: 725 Bytes
Contents
module Spina module Authentication module Sessions extend ActiveSupport::Concern included do helper_method :current_spina_user helper_method :logged_in? helper_method :logout_path end def current_spina_user Spina::Current.user ||= User.find_by(id: session[:spina_user_id]) if session[:spina_user_id] end def logged_in? current_spina_user end def logout_path spina.admin_logout_path end private def authenticate redirect_to admin_login_path, flash: {information: I18n.t('spina.notifications.login')} unless logged_in? end end end end
Version data entries
20 entries across 20 versions & 1 rubygems