diff --git a/app/controllers/deep_links_controller.rb b/app/controllers/deep_links_controller.rb index 326770e4c..64c295a00 100644 --- a/app/controllers/deep_links_controller.rb +++ b/app/controllers/deep_links_controller.rb @@ -1,4 +1,6 @@ class DeepLinksController < ApplicationController + AASA_PATHS = ["/*", "NOT /users/auth/*"].freeze + def mobile; end # Apple Application Site Association - based on Apple docs guidelines @@ -19,7 +21,7 @@ class DeepLinksController < ApplicationController render json: { applinks: { apps: [], - details: supported_apps.map { |app_id| { appID: app_id, paths: ["/*"] } } + details: supported_apps.map { |app_id| { appID: app_id, paths: AASA_PATHS } } }, activitycontinuation: { apps: supported_apps diff --git a/spec/requests/universal_links_spec.rb b/spec/requests/universal_links_spec.rb index 903ee0ca6..7fe33dfdc 100644 --- a/spec/requests/universal_links_spec.rb +++ b/spec/requests/universal_links_spec.rb @@ -3,6 +3,7 @@ require "rails_helper" RSpec.describe "Universal Links (Apple)", type: :request do let(:aasa_route) { "/.well-known/apple-app-site-association" } let(:forem_app_id) { "R9SWHSQNV8.com.forem.app" } + let(:expected_paths) { ["/*", "NOT /users/auth/*"] } describe "returns a valid Apple App Site Association file" do context "with multiple ConsumerApps" do @@ -20,7 +21,7 @@ RSpec.describe "Universal Links (Apple)", type: :request do expect(json_response.dig("applinks", "apps")).to be_empty json_response.dig("applinks", "details").each do |hash| expect(both_app_ids).to include(hash["appID"]) - expect(hash["paths"]).to match_array(["/*"]) + expect(hash["paths"]).to match_array(expected_paths) end end end @@ -34,7 +35,7 @@ RSpec.describe "Universal Links (Apple)", type: :request do expect(json_response.dig("applinks", "apps")).to be_empty json_response.dig("applinks", "details").each do |hash| expect(hash["appID"]).to eq(forem_app_id) - expect(hash["paths"]).to match_array(["/*"]) + expect(hash["paths"]).to match_array(expected_paths) end end end @@ -49,7 +50,7 @@ RSpec.describe "Universal Links (Apple)", type: :request do expect(json_response.dig("applinks", "apps")).to be_empty json_response.dig("applinks", "details").each do |hash| expect(hash["appID"]).to eq(forem_app_id) - expect(hash["paths"]).to match_array(["/*"]) + expect(hash["paths"]).to match_array(expected_paths) end end end