Redirect to waiting page on ongoing http header authentication fixes #9362

pull/9365/head
Juan Ignacio Sánchez Lara 8 years ago
parent 3aeb56f029
commit 31eb5a64a2

@ -74,7 +74,8 @@ class ApplicationController < ActionController::Base
authenticator = Carto::HttpHeaderAuthentication.new
if authenticator.autocreation_enabled?
if authenticator.creation_in_progress?(request)
render_http_code(409, 500, 'Creation already in progress')
# render_http_code(409, 500, 'Creation already in progress')
redirect_to CartoDB.path(self, 'signup_http_authentication_in_progress')
else
redirect_to CartoDB.path(self, 'signup_http_authentication')
end

@ -6,6 +6,7 @@ module Carto
class UserCreationsController < ::Api::ApplicationController
skip_before_filter :api_authorization_required
skip_before_filter :http_header_authentication, only: [:show]
ssl_required :show

@ -7,12 +7,12 @@ class SignupController < ApplicationController
layout 'frontend'
ssl_required :signup, :create, :create_http_authentication
ssl_required :signup, :create, :create_http_authentication, :create_http_authentication_in_progress
skip_before_filter :http_header_authentication, only: [:create_http_authentication]
skip_before_filter :http_header_authentication, only: [:create_http_authentication, :create_http_authentication_in_progress]
before_filter :load_organization, only: [:create_http_authentication]
before_filter :check_organization_quotas, only: [:create_http_authentication]
before_filter :load_organization, only: [:create_http_authentication, :create_http_authentication_in_progress]
before_filter :check_organization_quotas, only: [:create_http_authentication, :create_http_authentication_in_progress]
before_filter :load_mandatory_organization, only: [:signup, :create]
before_filter :disable_if_ldap_configured
before_filter :initialize_google_plus_config
@ -97,6 +97,12 @@ class SignupController < ApplicationController
render_500
end
def create_http_authentication_in_progress
authenticator = Carto::HttpHeaderAuthentication.new
render_500 unless authenticator.autocreation_enabled? && authenticator.creation_in_progress?(request)
render 'shared/signup_confirmation'
end
private
def trigger_account_creation(account_creator)

@ -16,6 +16,7 @@ CartoDB::Application.routes.draw do
get '/signup' => 'signup#signup', as: :signup
post '/signup' => 'signup#create', as: :signup_organization_user
get '(/user/:user_domain)(/u/:user_domain)/signup_http_authentication' => 'signup#create_http_authentication', as: :signup_http_authentication
get '(/user/:user_domain)(/u/:user_domain)/signup_http_authentication_in_progress' => 'signup#create_http_authentication_in_progress', as: :signup_http_authentication_in_progress
get '(/user/:user_domain)(/u/:user_domain)/enable_account_token/:id' => 'account_tokens#enable', as: :enable_account_token_show
get '(/user/:user_domain)(/u/:user_domain)/resend_validation_mail/:user_id' => 'account_tokens#resend', as: :resend_validation_mail

Loading…
Cancel
Save