From f5a952e3c2aeaf36ad8342a170e8325ed847400d Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Tue, 28 Jan 2025 16:26:08 +0530 Subject: [PATCH 1/9] get chatwoot identity verification working --- .env.development.sample | 2 + .../email/sessions_controller.rb | 12 +++--- app/models/accounts/user.rb | 4 ++ .../layouts/signed_in_application.html.erb | 32 +++++++++++++-- lib/chatwoot/shutdown_helper.rb | 39 +++++++++++++++++++ 5 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 lib/chatwoot/shutdown_helper.rb diff --git a/.env.development.sample b/.env.development.sample index 8cca75290..04f5ba230 100644 --- a/.env.development.sample +++ b/.env.development.sample @@ -30,3 +30,5 @@ NGROK_AUTHTOKEN= NGROK_REGION=in RAILS_MASTER_KEY= ACTIVE_STORAGE_LOCATION=local +CHATWOOT_WEBSITE_TOKEN= +CHATWOOT_IDENTITY_VERIFICATION_TOKEN= diff --git a/app/controllers/authentication/email/sessions_controller.rb b/app/controllers/authentication/email/sessions_controller.rb index f4358e83c..ada37e0c5 100644 --- a/app/controllers/authentication/email/sessions_controller.rb +++ b/app/controllers/authentication/email/sessions_controller.rb @@ -3,8 +3,8 @@ class Authentication::Email::SessionsController < Devise::SessionsController before_action :skip_authentication, only: [:new, :create] before_action :set_confirmed_email, only: [:new] - after_action :prepare_intercom_shutdown, only: [:destroy] - after_action :intercom_shutdown, only: [:new] + after_action :prepare_support_chat_shutdown, only: [:destroy] + after_action :support_chat_shutdown, only: [:new] after_action :track_login, only: [:create] def new @@ -21,12 +21,12 @@ def destroy protected - def prepare_intercom_shutdown - IntercomRails::ShutdownHelper.prepare_intercom_shutdown(session) + def prepare_support_chat_shutdown + Chatwoot::ShutdownHelper.prepare_chatwoot_shutdown(session) end - def intercom_shutdown - IntercomRails::ShutdownHelper.intercom_shutdown(session, cookies, request.domain) + def support_chat_shutdown + Chatwoot::ShutdownHelper.chatwoot_shutdown(session, cookies, request.domain) end def set_confirmed_email diff --git a/app/models/accounts/user.rb b/app/models/accounts/user.rb index 592cdb443..b1eb8241a 100644 --- a/app/models/accounts/user.rb +++ b/app/models/accounts/user.rb @@ -202,6 +202,10 @@ def pending_profile?(organization) github_login.blank? || team_for(organization).blank? end + def support_chat_identifier + OpenSSL::HMAC.hexdigest("sha256", ENV["CHATWOOT_IDENTITY_VERIFICATION_TOKEN"], id) + end + protected def confirmation_required? diff --git a/app/views/layouts/signed_in_application.html.erb b/app/views/layouts/signed_in_application.html.erb index 21c8e6a42..eeeda6415 100644 --- a/app/views/layouts/signed_in_application.html.erb +++ b/app/views/layouts/signed_in_application.html.erb @@ -4,6 +4,9 @@ <%= render partial: "shared/favicon" %> <%= page_title(@page_name, current_organization, @app, @release) %> + + "/> + <%= csrf_meta_tags %> <%= csp_meta_tag %> @@ -14,9 +17,32 @@ <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> - - "/> - + diff --git a/lib/chatwoot/shutdown_helper.rb b/lib/chatwoot/shutdown_helper.rb new file mode 100644 index 000000000..62acab886 --- /dev/null +++ b/lib/chatwoot/shutdown_helper.rb @@ -0,0 +1,39 @@ +module Chatwoot + module ShutdownHelper + # This helper allows to erase cookies when a user log out of an application + # It is recommended to call this function every time a user log out of your application + # Do not use before a redirect_to because it will not clear the cookies on a redirection + def self.chatwoot_shutdown_helper(cookies, domain = nil) + nil_session = { value: nil, expires: 1.day.ago } + nil_session = nil_session.merge(domain: domain) unless domain.nil? || domain == "localhost" + chatwoot_token = ENV["CHATWOOT_WEBSITE_TOKEN"] + session_cookie = "cw_user_#{chatwoot_token}" + conversation_cookie = "cw_conversation" + + if cookies.is_a?(ActionDispatch::Cookies::CookieJar) + cookies[session_cookie] = nil_session + cookies[conversation_cookie] = nil_session + else + controller = cookies + controller.response.delete_cookie(session_cookie, nil_session) + controller.response.delete_cookie(conversation_cookie, nil_session) + end + + Rails.logger.debug { "Chatwoot: sessions cleared" } + rescue + Rails.logger.debug { "Chatwoot: shutdown failed" } + nil + end + + def self.prepare_chatwoot_shutdown(session) + session[:perform_chatwoot_shutdown] = true + end + + def self.chatwoot_shutdown(session, cookies, domain = nil) + if session[:perform_chatwoot_shutdown] + session.delete(:perform_chatwoot_shutdown) + chatwoot_shutdown_helper(cookies, domain) + end + end + end +end From af75854f3de9971b572e483201c5aab73ede994b Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Tue, 28 Jan 2025 17:03:40 +0530 Subject: [PATCH 2/9] lint --- lib/chatwoot/shutdown_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chatwoot/shutdown_helper.rb b/lib/chatwoot/shutdown_helper.rb index 62acab886..6e3be47e3 100644 --- a/lib/chatwoot/shutdown_helper.rb +++ b/lib/chatwoot/shutdown_helper.rb @@ -4,7 +4,7 @@ module ShutdownHelper # It is recommended to call this function every time a user log out of your application # Do not use before a redirect_to because it will not clear the cookies on a redirection def self.chatwoot_shutdown_helper(cookies, domain = nil) - nil_session = { value: nil, expires: 1.day.ago } + nil_session = {value: nil, expires: 1.day.ago} nil_session = nil_session.merge(domain: domain) unless domain.nil? || domain == "localhost" chatwoot_token = ENV["CHATWOOT_WEBSITE_TOKEN"] session_cookie = "cw_user_#{chatwoot_token}" From 350699dad463798e5cbf8cad71cf3f053db2cc69 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Tue, 28 Jan 2025 17:13:38 +0530 Subject: [PATCH 3/9] minor --- lib/chatwoot/shutdown_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/chatwoot/shutdown_helper.rb b/lib/chatwoot/shutdown_helper.rb index 6e3be47e3..a6be1af0c 100644 --- a/lib/chatwoot/shutdown_helper.rb +++ b/lib/chatwoot/shutdown_helper.rb @@ -1,7 +1,6 @@ module Chatwoot module ShutdownHelper - # This helper allows to erase cookies when a user log out of an application - # It is recommended to call this function every time a user log out of your application + # This helper allows to erase cookies when a user logs out of an application # Do not use before a redirect_to because it will not clear the cookies on a redirection def self.chatwoot_shutdown_helper(cookies, domain = nil) nil_session = {value: nil, expires: 1.day.ago} @@ -19,7 +18,7 @@ def self.chatwoot_shutdown_helper(cookies, domain = nil) controller.response.delete_cookie(conversation_cookie, nil_session) end - Rails.logger.debug { "Chatwoot: sessions cleared" } + Rails.logger.debug { "Chatwoot: session cleared" } rescue Rails.logger.debug { "Chatwoot: shutdown failed" } nil From 3dad53d3cb096c8a490b235609128cf76d031580 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Mon, 17 Feb 2025 11:14:35 +0530 Subject: [PATCH 4/9] add frame-src allowlists in csp --- config/initializers/content_security_policy.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 14cb7a298..8b894aa9f 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -32,6 +32,7 @@ def report_only policy.connect_src(:self, *connect_src_uris) policy.child_src(:self, *connect_src_uris) policy.report_uri(csp_reporting_uri.to_s) if csp_reporting_uri.present? + policy.frame_src(:self, *connect_src_uris) end Rails.application.config.content_security_policy_nonce_generator = ->(request) { Base64.strict_encode64(request.session.id.to_s) } From 1383d1c24a93c9c0f672a662a372ed30db011111 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Mon, 17 Feb 2025 11:43:05 +0530 Subject: [PATCH 5/9] add concern for support chat --- .../email/sessions_controller.rb | 11 +---------- .../authentication/sso/sessions_controller.rb | 11 +---------- app/controllers/concerns/supportable.rb | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 app/controllers/concerns/supportable.rb diff --git a/app/controllers/authentication/email/sessions_controller.rb b/app/controllers/authentication/email/sessions_controller.rb index ada37e0c5..631ed82a3 100644 --- a/app/controllers/authentication/email/sessions_controller.rb +++ b/app/controllers/authentication/email/sessions_controller.rb @@ -1,10 +1,9 @@ class Authentication::Email::SessionsController < Devise::SessionsController include Authenticatable + include Supportable before_action :skip_authentication, only: [:new, :create] before_action :set_confirmed_email, only: [:new] - after_action :prepare_support_chat_shutdown, only: [:destroy] - after_action :support_chat_shutdown, only: [:new] after_action :track_login, only: [:create] def new @@ -21,14 +20,6 @@ def destroy protected - def prepare_support_chat_shutdown - Chatwoot::ShutdownHelper.prepare_chatwoot_shutdown(session) - end - - def support_chat_shutdown - Chatwoot::ShutdownHelper.chatwoot_shutdown(session, cookies, request.domain) - end - def set_confirmed_email @confirmed_email = params[:confirmed_email].presence || nil end diff --git a/app/controllers/authentication/sso/sessions_controller.rb b/app/controllers/authentication/sso/sessions_controller.rb index c7af4653d..b794a5f5e 100644 --- a/app/controllers/authentication/sso/sessions_controller.rb +++ b/app/controllers/authentication/sso/sessions_controller.rb @@ -1,9 +1,8 @@ class Authentication::Sso::SessionsController < ApplicationController include Authenticatable + include Supportable before_action :skip_authentication, only: [:new, :create] - after_action :prepare_intercom_shutdown, only: [:destroy] - after_action :intercom_shutdown, only: [:new] def new set_invite @@ -63,14 +62,6 @@ def set_invite @invite = Accounts::Invite.find_by(token: invite_token) if invite_token.present? end - def prepare_intercom_shutdown - IntercomRails::ShutdownHelper.prepare_intercom_shutdown(session) - end - - def intercom_shutdown - IntercomRails::ShutdownHelper.intercom_shutdown(session, cookies, request.domain) - end - def track_login SiteAnalytics.track(current_user, current_organization, device, "Login", {sso: true}) end diff --git a/app/controllers/concerns/supportable.rb b/app/controllers/concerns/supportable.rb new file mode 100644 index 000000000..89483f3d2 --- /dev/null +++ b/app/controllers/concerns/supportable.rb @@ -0,0 +1,18 @@ +module Supportable + extend ActiveSupport::Concern + + included do + after_action :prepare_support_chat_shutdown, only: [:destroy] + after_action :support_chat_shutdown, only: [:new] + end + + protected + + def prepare_support_chat_shutdown + Chatwoot::ShutdownHelper.prepare_chatwoot_shutdown(session) + end + + def support_chat_shutdown + Chatwoot::ShutdownHelper.chatwoot_shutdown(session, cookies, request.domain) + end +end From 10516aa8b47766c91fbbf482ebc80670cc63ead3 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Mon, 17 Feb 2025 12:04:26 +0530 Subject: [PATCH 6/9] remove intercom --- Gemfile | 1 - Gemfile.lock | 3 - config/initializers/intercom.rb | 118 ------------------ .../intercom_rails/auto_include.rb | 9 -- 4 files changed, 131 deletions(-) delete mode 100644 config/initializers/intercom.rb delete mode 100644 lib/core_extensions/intercom_rails/auto_include.rb diff --git a/Gemfile b/Gemfile index 7739463f5..576386f5f 100644 --- a/Gemfile +++ b/Gemfile @@ -64,7 +64,6 @@ gem "pagy", "~> 6.0" gem "view_component", "~> 3.0" gem "activerecord_json_validator", "~> 2.1" gem "sidekiq-cron", "~> 1.9" -gem "intercom-rails", "~> 0.4.2" gem "google-apis-firebaseappdistribution_v1", "~> 0.1" gem "google-apis-firebase_v1beta1", "~> 0.35.0" gem "initials", "~> 0.4.3" diff --git a/Gemfile.lock b/Gemfile.lock index a6bfd1ac4..a016dc33c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -318,8 +318,6 @@ GEM activesupport (>= 6.0.0) railties (>= 6.0.0) initials (0.4.3) - intercom-rails (0.4.2) - activesupport (> 3.0) invisible_captcha (2.3.0) rails (>= 5.2) io-console (0.7.2) @@ -798,7 +796,6 @@ DEPENDENCIES http (~> 5.0) importmap-rails (~> 1.0) initials (~> 0.4.3) - intercom-rails (~> 0.4.2) invisible_captcha (~> 2.3) jbuilder (~> 2.11) json-schema (~> 4.1) diff --git a/config/initializers/intercom.rb b/config/initializers/intercom.rb deleted file mode 100644 index a132bd704..000000000 --- a/config/initializers/intercom.rb +++ /dev/null @@ -1,118 +0,0 @@ -IntercomRails.config do |config| - # == Intercom app_id - # - config.app_id = ENV["INTERCOM_APP_ID"] - - # == Intercom session_duration - # - # config.session_duration = 300000 - # == Intercom secret key - # This is required to enable Identity Verification, you can find it on your Setup - # guide in the "Identity Verification" step. - # - config.api_secret = Rails.application.credentials.intercom_secure_mode_secret_key - - # == Enabled Environments - # Which environments is auto inclusion of the Javascript enabled for - # - config.enabled_environments = %w[production] - - # == Current user method/variable - # The method/variable that contains the logged in user in your controllers. - # If it is `current_user` or `@user`, then you can ignore this - # - config.user.current = proc { current_user } - # config.user.current = [Proc.new { current_user }] - - # == Include for logged out Users - # If set to true, include the Intercom messenger on all pages, regardless of whether - # The user model class (set below) is present. - # config.include_for_logged_out_users = true - - # == User model class - # The class which defines your user model - # - # config.user.model = Proc.new { Accounts::User } - - # == Lead/custom attributes for non-signed up users - # Pass additional attributes to for potential leads or - # non-signed up users as an an array. - # Any attribute contained in config.user.lead_attributes can be used - # as custom attribute in the application. - # config.user.lead_attributes = %w(ref_data utm_source) - - # == Exclude users - # A Proc that given a user returns true if the user should be excluded - # from imports and Javascript inclusion, false otherwise. - # - config.user.exclude_if = proc { |user| user.admin? } - - # == User Custom Data - # A hash of additional data you wish to send about your users. - # You can provide either a method name which will be sent to the current - # user object, or a Proc which will be passed the current user. - # - config.user.custom_data = { - name: proc { |current_user| current_user.full_name }, - preferred_name: proc { |current_user| current_user.preferred_name } - } - - # == Current company method/variable - # The method/variable that contains the current company for the current user, - # in your controllers. 'Companies' are generic groupings of users, so this - # could be a company, app or group. - # - config.company.current = proc { current_organization } - # - # Or if you are using devise you can just use the following config - # - # config.company.current = Proc.new { current_user.company } - - # == Exclude company - # A Proc that given a company returns true if the company should be excluded - # from imports and Javascript inclusion, false otherwise. - # - # config.company.exclude_if = Proc.new { |app| app.subdomain == 'demo' } - - # == Company Custom Data - # A hash of additional data you wish to send about a company. - # This works the same as User custom data above. - # - config.company.custom_data = { - id: proc { |current_organization| current_organization.id }, - name: proc { |current_organization| current_organization.name } - } - - # == Company Plan name - # This is the name of the plan a company is currently paying (or not paying) for. - # e.g. Messaging, Free, Pro, etc. - # - # config.company.plan = Proc.new { |current_company| current_company.plan.name } - - # == Company Monthly Spend - # This is the amount the company spends each month on your app. If your company - # has a plan, it will set the 'total value' of that plan appropriately. - # - # config.company.monthly_spend = Proc.new { |current_company| current_company.plan.price } - # config.company.monthly_spend = Proc.new { |current_company| (current_company.plan.price - current_company.subscription.discount) } - - # == Custom Style - # By default, Intercom will add a button that opens the messenger to - # the page. If you'd like to use your own link to open the messenger, - # uncomment this line and clicks on any element with id 'Intercom' will - # open the messenger. - # - # config.inbox.style = :custom - # - # If you'd like to use your own link activator CSS selector - # uncomment this line and clicks on any element that matches the query will - # open the messenger - # config.inbox.custom_activator = '.intercom' - # - # If you'd like to hide default launcher button uncomment this line - config.hide_default_launcher = false - # - # If you need to route your Messenger requests through a different endpoint than the default, uncomment the below line. Generally speaking, this is not needed. - # config.api_base = "https://#{config.app_id}.intercom-messenger.com" - # -end diff --git a/lib/core_extensions/intercom_rails/auto_include.rb b/lib/core_extensions/intercom_rails/auto_include.rb deleted file mode 100644 index 494fbbb18..000000000 --- a/lib/core_extensions/intercom_rails/auto_include.rb +++ /dev/null @@ -1,9 +0,0 @@ -module CoreExtensions - module IntercomRails - module AutoInclude - def self.csp_nonce_hook(controller) - Base64.strict_encode64(controller.request.session.id.to_s) - end - end - end -end From c029dd41bb0656f81144552f489bdd4248b4016f Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Mon, 17 Feb 2025 12:09:19 +0530 Subject: [PATCH 7/9] only load in production --- app/controllers/concerns/supportable.rb | 6 ++- .../layouts/signed_in_application.html.erb | 48 ++++++++++--------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/app/controllers/concerns/supportable.rb b/app/controllers/concerns/supportable.rb index 89483f3d2..80749d1c6 100644 --- a/app/controllers/concerns/supportable.rb +++ b/app/controllers/concerns/supportable.rb @@ -2,8 +2,10 @@ module Supportable extend ActiveSupport::Concern included do - after_action :prepare_support_chat_shutdown, only: [:destroy] - after_action :support_chat_shutdown, only: [:new] + if Rails.production? + after_action :prepare_support_chat_shutdown, only: [:destroy] + after_action :support_chat_shutdown, only: [:new] + end end protected diff --git a/app/views/layouts/signed_in_application.html.erb b/app/views/layouts/signed_in_application.html.erb index e6e698ea3..e7c88393e 100644 --- a/app/views/layouts/signed_in_application.html.erb +++ b/app/views/layouts/signed_in_application.html.erb @@ -17,32 +17,34 @@ <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> - + + <% end %> "/> From 9ad9d0c11fac29d3456a7f350eb1a593613cf932 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Mon, 17 Feb 2025 12:16:55 +0530 Subject: [PATCH 8/9] don't need concerns --- .../authentication/email/sessions_controller.rb | 2 ++ .../authentication/sso/sessions_controller.rb | 2 ++ app/controllers/concerns/supportable.rb | 9 --------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/controllers/authentication/email/sessions_controller.rb b/app/controllers/authentication/email/sessions_controller.rb index 631ed82a3..71f81aa30 100644 --- a/app/controllers/authentication/email/sessions_controller.rb +++ b/app/controllers/authentication/email/sessions_controller.rb @@ -4,6 +4,8 @@ class Authentication::Email::SessionsController < Devise::SessionsController before_action :skip_authentication, only: [:new, :create] before_action :set_confirmed_email, only: [:new] + after_action :prepare_support_chat_shutdown, only: [:destroy] + after_action :support_chat_shutdown, only: [:new] after_action :track_login, only: [:create] def new diff --git a/app/controllers/authentication/sso/sessions_controller.rb b/app/controllers/authentication/sso/sessions_controller.rb index b794a5f5e..78c5795b2 100644 --- a/app/controllers/authentication/sso/sessions_controller.rb +++ b/app/controllers/authentication/sso/sessions_controller.rb @@ -3,6 +3,8 @@ class Authentication::Sso::SessionsController < ApplicationController include Supportable before_action :skip_authentication, only: [:new, :create] + after_action :prepare_support_chat_shutdown, only: [:destroy] + after_action :support_chat_shutdown, only: [:new] def new set_invite diff --git a/app/controllers/concerns/supportable.rb b/app/controllers/concerns/supportable.rb index 80749d1c6..c4e275503 100644 --- a/app/controllers/concerns/supportable.rb +++ b/app/controllers/concerns/supportable.rb @@ -1,13 +1,4 @@ module Supportable - extend ActiveSupport::Concern - - included do - if Rails.production? - after_action :prepare_support_chat_shutdown, only: [:destroy] - after_action :support_chat_shutdown, only: [:new] - end - end - protected def prepare_support_chat_shutdown From 54ed3da0a9789fcfa8db42d26d9df41a0b633bc7 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Mon, 17 Feb 2025 13:30:46 +0530 Subject: [PATCH 9/9] remove supportable --- .../email/sessions_controller.rb | 9 +++- .../authentication/sso/sessions_controller.rb | 9 +++- app/controllers/concerns/supportable.rb | 11 ----- .../layouts/signed_in_application.html.erb | 48 +++++++++---------- 4 files changed, 39 insertions(+), 38 deletions(-) delete mode 100644 app/controllers/concerns/supportable.rb diff --git a/app/controllers/authentication/email/sessions_controller.rb b/app/controllers/authentication/email/sessions_controller.rb index 71f81aa30..3cbb2534c 100644 --- a/app/controllers/authentication/email/sessions_controller.rb +++ b/app/controllers/authentication/email/sessions_controller.rb @@ -1,6 +1,5 @@ class Authentication::Email::SessionsController < Devise::SessionsController include Authenticatable - include Supportable before_action :skip_authentication, only: [:new, :create] before_action :set_confirmed_email, only: [:new] @@ -29,4 +28,12 @@ def set_confirmed_email def track_login SiteAnalytics.track(current_user, current_organization, device, "Login", {email: true}) end + + def prepare_support_chat_shutdown + Chatwoot::ShutdownHelper.prepare_chatwoot_shutdown(session) + end + + def support_chat_shutdown + Chatwoot::ShutdownHelper.chatwoot_shutdown(session, cookies, request.domain) + end end diff --git a/app/controllers/authentication/sso/sessions_controller.rb b/app/controllers/authentication/sso/sessions_controller.rb index 78c5795b2..9d6c3e66b 100644 --- a/app/controllers/authentication/sso/sessions_controller.rb +++ b/app/controllers/authentication/sso/sessions_controller.rb @@ -1,6 +1,5 @@ class Authentication::Sso::SessionsController < ApplicationController include Authenticatable - include Supportable before_action :skip_authentication, only: [:new, :create] after_action :prepare_support_chat_shutdown, only: [:destroy] @@ -67,4 +66,12 @@ def set_invite def track_login SiteAnalytics.track(current_user, current_organization, device, "Login", {sso: true}) end + + def prepare_support_chat_shutdown + Chatwoot::ShutdownHelper.prepare_chatwoot_shutdown(session) + end + + def support_chat_shutdown + Chatwoot::ShutdownHelper.chatwoot_shutdown(session, cookies, request.domain) + end end diff --git a/app/controllers/concerns/supportable.rb b/app/controllers/concerns/supportable.rb deleted file mode 100644 index c4e275503..000000000 --- a/app/controllers/concerns/supportable.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Supportable - protected - - def prepare_support_chat_shutdown - Chatwoot::ShutdownHelper.prepare_chatwoot_shutdown(session) - end - - def support_chat_shutdown - Chatwoot::ShutdownHelper.chatwoot_shutdown(session, cookies, request.domain) - end -end diff --git a/app/views/layouts/signed_in_application.html.erb b/app/views/layouts/signed_in_application.html.erb index e7c88393e..e6e698ea3 100644 --- a/app/views/layouts/signed_in_application.html.erb +++ b/app/views/layouts/signed_in_application.html.erb @@ -17,34 +17,32 @@ <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> - <% if Rails.env.production? %> - - <% end %> + }); + "/>