Sha256: d86d37e7fe1eabc84c4d7de41d02b9fb759f0c31e7867a40fbc4f71635779f4f
Contents?: true
Size: 679 Bytes
Versions: 20
Compression:
Stored size: 679 Bytes
Contents
module Spina module Admin class SessionsController < AdminController skip_before_action :authenticate def new end def create user = User.where(email: params[:email]).first if user && user.authenticate(params[:password]) session[:spina_user_id] = user.id user.touch(:last_logged_in) redirect_to spina.admin_root_url else flash.now[:alert] = I18n.t('spina.notifications.wrong_username_or_password') render "new", status: :unprocessable_entity end end def destroy session.delete(:spina_user_id) redirect_to "/" end end end end
Version data entries
20 entries across 20 versions & 1 rubygems