From 06cb22e02b98ecb6d609459162e0fc122466d836 Mon Sep 17 00:00:00 2001 From: Eda Riedl Date: Wed, 13 Sep 2023 17:47:15 +0200 Subject: [PATCH] chore: Fix rack deprecation warnings. Replace `request[]` calls with `request.params[]`. To fix the deprecation warnings in: and 3.x: https://github.com/rack/rack/blob/3-0-stable/lib/rack/request.rb#L608 Rack 2.x: https://github.com/rack/rack/blob/2-2-stable/lib/rack/request.rb#L531 --- lib/googleauth/web_user_authorizer.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/googleauth/web_user_authorizer.rb b/lib/googleauth/web_user_authorizer.rb index da8ce491..1c9f7b8b 100644 --- a/lib/googleauth/web_user_authorizer.rb +++ b/lib/googleauth/web_user_authorizer.rb @@ -192,13 +192,13 @@ def get_credentials user_id, request = nil, scope = nil end def self.extract_callback_state request - state = MultiJson.load(request[STATE_PARAM] || "{}") + state = MultiJson.load(request.params[STATE_PARAM] || "{}") redirect_uri = state[CURRENT_URI_KEY] callback_state = { - AUTH_CODE_KEY => request[AUTH_CODE_KEY], - ERROR_CODE_KEY => request[ERROR_CODE_KEY], + AUTH_CODE_KEY => request.params[AUTH_CODE_KEY], + ERROR_CODE_KEY => request.params[ERROR_CODE_KEY], SESSION_ID_KEY => state[SESSION_ID_KEY], - SCOPE_KEY => request[SCOPE_KEY] + SCOPE_KEY => request.params[SCOPE_KEY] } [callback_state, redirect_uri] end