mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-01 20:25:26 +00:00
Upgraded to rails 8.0.2, moved from dalli to solid cache, moved from delayed_job to solid queue, and add solid cable. deploy/rails-dev-run.sh no longer needs to chmod. Fixed finished_at callback for matches. Migrated from Devise to built in rails auth. Added view tests for the bracket page testing that all bout numbers render for all matches in each bracket type.
This commit is contained in:
20
app/controllers/sessions_controller.rb
Normal file
20
app/controllers/sessions_controller.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class SessionsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
user = User.find_by(email: params[:session][:email].downcase)
|
||||
if user && user.authenticate(params[:session][:password])
|
||||
session[:user_id] = user.id
|
||||
redirect_to root_path, notice: "Logged in successfully"
|
||||
else
|
||||
flash.now[:alert] = "Invalid email/password combination"
|
||||
render 'new'
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
session.delete(:user_id)
|
||||
redirect_to root_path, notice: "Logged out successfully"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user