Commit 08d513a5 authored by Dennis Tang's avatar Dennis Tang

redirect back to form if token expires

parent edb89f55
...@@ -7,6 +7,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController ...@@ -7,6 +7,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
helper_method :valid_gcp_token helper_method :valid_gcp_token
def create def create
if valid_gcp_token
@cluster = ::Clusters::CreateService @cluster = ::Clusters::CreateService
.new(project, current_user, create_params) .new(project, current_user, create_params)
.execute(token_in_session) .execute(token_in_session)
...@@ -19,6 +20,9 @@ class Projects::Clusters::GcpController < Projects::ApplicationController ...@@ -19,6 +20,9 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
render 'projects/clusters/new', locals: { active_tab: 'gcp' } render 'projects/clusters/new', locals: { active_tab: 'gcp' }
end end
else
redirect_to new_project_cluster_path(@project)
end
end end
private private
......
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