Skip to content

Commit d2d572e

Browse files
committed
FIX: AI share page assets via CDN on login-required sites
AI share page assets are loaded via the app CDN, which means the requests have no authentication and will never appear to the app as "logged in". Therefore we should skip the `redirect_to_login_if_required` before_action.
1 parent 7316058 commit d2d572e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/discourse_ai/ai_bot/shared_ai_conversations_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class SharedAiConversationsController < ::ApplicationController
88
before_action :require_site_settings!
99

1010
skip_before_action :preload_json, :check_xhr, only: %i[show asset]
11-
skip_before_action :verify_authenticity_token, only: ["asset"]
11+
skip_before_action :redirect_to_login_if_required, :verify_authenticity_token, only: %i[asset]
1212

1313
def create
1414
ensure_allowed_create!

0 commit comments

Comments
 (0)