diff --git a/app/controllers/api/v1/accounts/integrations/captain_controller.rb b/app/controllers/api/v1/accounts/integrations/captain_controller.rb index 88547209c..7df0e61df 100644 --- a/app/controllers/api/v1/accounts/integrations/captain_controller.rb +++ b/app/controllers/api/v1/accounts/integrations/captain_controller.rb @@ -8,7 +8,9 @@ class Api::V1::Accounts::Integrations::CaptainController < Api::V1::Accounts::Ba "&email=#{URI.encode_www_form_component(@hook['settings']['account_email'])}" \ "&account_id=#{URI.encode_www_form_component(@hook['settings']['account_id'])}" - sso_url = "#{ENV.fetch('CAPTAIN_APP_URL', '')}/sso?#{params_string}" + installation_config = InstallationConfig.find_by(name: 'CAPTAIN_APP_URL') + + sso_url = "#{installation_config.value}/sso?#{params_string}" render json: { sso_url: sso_url }, status: :ok end diff --git a/app/javascript/v3/views/login/Index.vue b/app/javascript/v3/views/login/Index.vue index b557c55c5..677b6b87f 100644 --- a/app/javascript/v3/views/login/Index.vue +++ b/app/javascript/v3/views/login/Index.vue @@ -105,11 +105,6 @@ export default { useAlert(this.loginApi.message); }, submitLogin() { - if (this.v$.credentials.email.$invalid && !this.email) { - this.showAlertMessage(this.$t('LOGIN.EMAIL.ERROR')); - return; - } - this.loginApi.hasErrored = false; this.loginApi.showLoading = true; @@ -138,6 +133,14 @@ export default { ); }); }, + submitFormLogin() { + if (this.v$.credentials.email.$invalid && !this.email) { + this.showAlertMessage(this.$t('LOGIN.EMAIL.ERROR')); + return; + } + + this.submitLogin(); + }, }, }; @@ -184,7 +187,7 @@ export default { >