Files
adamantium/slices/admin/actions/sessions/validate.rb
2023-12-02 20:36:29 +11:00

19 lines
381 B
Ruby

module Admin
module Actions
module Sessions
class Validate < Action
include Deps["commands.sessions.validate"]
def handle(req, res)
user_id = validate.call(token: req.params[:token])
session = req.env["rack.session"]
session[:user_id] = user_id
res.redirect_to "/admin"
end
end
end
end
end