docs: Add Playwright MCP documentation and update testing instructions
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'bcrypt'
|
||||
|
||||
module EuchreCamp
|
||||
module Actions
|
||||
module Auth
|
||||
@@ -14,12 +16,21 @@ module EuchreCamp
|
||||
user = users_repo.by_email(email)
|
||||
|
||||
if user && valid_password?(user, password)
|
||||
if user.locked?
|
||||
# Check if account is locked
|
||||
locked_until = user[:locked_until]
|
||||
if locked_until && locked_until > Time.now
|
||||
response.flash[:error] = 'Account is locked. Please contact support.'
|
||||
response.redirect_to '/login'
|
||||
return
|
||||
end
|
||||
|
||||
# Check if account is confirmed
|
||||
unless user[:confirmed]
|
||||
response.flash[:error] = 'Account not confirmed. Please check your email.'
|
||||
response.redirect_to '/login'
|
||||
return
|
||||
end
|
||||
|
||||
# Record successful login
|
||||
ip_address = request.env['REMOTE_ADDR']
|
||||
users_repo.record_login(user[:id], ip_address)
|
||||
@@ -30,7 +41,7 @@ module EuchreCamp
|
||||
session[:player_id] = user[:player_id]
|
||||
|
||||
response.flash[:success] = 'Welcome back!'
|
||||
response.redirect_to '/rankings'
|
||||
response.redirect_to '/'
|
||||
else
|
||||
# Record failed login
|
||||
users_repo.record_failed_login(user[:id]) if user
|
||||
|
||||
Reference in New Issue
Block a user