28 lines
643 B
Ruby
28 lines
643 B
Ruby
# frozen_string_literal: true
|
|
|
|
module EuchreCamp
|
|
module Actions
|
|
module Auth
|
|
module Login
|
|
class Show < EuchreCamp::Action
|
|
include Deps[users_repo: 'repositories.users', players_repo: 'repositories.players']
|
|
|
|
def handle(request, response)
|
|
player = current_player(request)
|
|
response.render(view, current_player: player)
|
|
end
|
|
|
|
protected
|
|
|
|
def current_player(request)
|
|
player_id = request.session[:player_id]
|
|
return nil unless player_id
|
|
|
|
players_repo.by_id(player_id)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|