From 7bf0a865d0c1e6b4e5deed0ba41500bd116152b0 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Fri, 5 Apr 2024 22:44:55 +0900 Subject: [PATCH] Fix: Fix redis.get --- backend/app/controllers/sonolus_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/controllers/sonolus_controller.rb b/backend/app/controllers/sonolus_controller.rb index cee341f..8e2057d 100644 --- a/backend/app/controllers/sonolus_controller.rb +++ b/backend/app/controllers/sonolus_controller.rb @@ -31,7 +31,9 @@ class SonolusController < ApplicationController end session_id = request.headers["Sonolus-Session"] unless user_profile = - $redis.with { |c| c.get("sonolus_session/#{session_id}") } + $redis + .with { |c| c.get("sonolus_session/#{session_id}") } + &.then { |json| JSON.parse(json, symbolize_names: true) } logger.warn "Invalid session id: #{session_id}" render json: { error: "Session expired" }, status: :unauthorized next