diff options
Diffstat (limited to 'lib/google_api')
-rw-r--r-- | lib/google_api/cloud_platform/client.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/google_api/cloud_platform/client.rb b/lib/google_api/cloud_platform/client.rb index 6d0c148b261..a440a3e3562 100644 --- a/lib/google_api/cloud_platform/client.rb +++ b/lib/google_api/cloud_platform/client.rb @@ -16,9 +16,14 @@ module GoogleApi :cloud_platform_expires_at end - def session_key_for_second_redirect_uri(secure: nil) - secure = SecureRandom.hex unless secure - return "cloud_platform_second_redirect_uri_#{secure}", secure + def new_session_key_for_redirect_uri + SecureRandom.hex.tap do |state| + yield session_key_for_redirect_uri(state) + end + end + + def session_key_for_redirect_uri(state) + "cloud_platform_second_redirect_uri_#{state}" end end |