Sha256: 802d5f40b43df8df8293d038a6aebe856cafb74309062f315258630af1af53ea
Contents?: true
Size: 646 Bytes
Versions: 9
Compression:
Stored size: 646 Bytes
Contents
class Admin::SessionsController < Admin::ApplicationController skip_before_action :authenticate, only: %i[ new create ] layout "admin/authentication" def new @admin_user = AdminUser.new end def create @admin_user = AdminUser.find_by(email: params[:email]) if @admin_user && @admin_user.authenticate(params[:password]) session[:admin_user_id] = @admin_user.id redirect_to admin_path else redirect_to admin_sign_in_path(email_hint: params[:email]), alert: "That email or password is incorrect" end end def destroy session[:admin_user_id] = nil; redirect_to admin_sign_in_path end end
Version data entries
9 entries across 9 versions & 1 rubygems