FIX: Webauthn origin was incorrect for subfolder setups (#25651)

This commit is contained in:
Penar Musaraj
2024-02-12 16:27:24 -05:00
committed by GitHub
parent 7eb1215cb1
commit 021a02c3d8
7 changed files with 44 additions and 11 deletions

View File

@ -183,6 +183,7 @@ RSpec.describe SecondFactorManager do
disable_totp
simulate_localhost_webauthn_challenge
DiscourseWebauthn.stage_challenge(user, secure_session)
DiscourseWebauthn.stubs(:origin).returns("http://localhost:3000")
end
context "when security key params are valid" do
@ -265,6 +266,7 @@ RSpec.describe SecondFactorManager do
before do
simulate_localhost_webauthn_challenge
DiscourseWebauthn.stage_challenge(user, secure_session)
DiscourseWebauthn.stubs(:origin).returns("http://localhost:3000")
end
context "when method selected is invalid" do