Commit 6f3c38f3 authored by Matija Čupić's avatar Matija Čupić

Store OAuth token in Redis for worker to pick up

parent 16447845
......@@ -65,7 +65,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
end
def authorize_google_project_billing
CheckGcpProjectBillingWorker.perform_async(token_in_session)
redis_token_key = CheckGcpProjectBillingWorker.generate_redis_token_key
Gitlab::Redis::SharedState.with do |redis|
redis.set(redis_token_key, token_in_session, ex: 5.minutes)
end
CheckGcpProjectBillingWorker.perform_async(redis_token_key)
end
def google_project_billing_status
......
......@@ -22,7 +22,7 @@ feature 'Gcp Cluster', :js do
context 'when user has a GCP project with billing enabled' do
before do
allow(CheckGcpProjectBillingWorker).to receive(:perform_async)
allow_any_instance_of(Projects::Clusters::GcpController).to receive(:authorize_google_project_billing)
stub_google_project_billing_status
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment