DEV: Refactor rp_id and rp_name (#23339)

They're both constant per-instance values, there is no need to store them
in the session. This also makes the code a bit more readable by moving
the `session_challenge_key` method up to the `DiscourseWebauthn` module.
This commit is contained in:
Penar Musaraj
2023-08-31 09:11:23 -04:00
committed by GitHub
parent 5724b7bccd
commit 006a5166e5
8 changed files with 28 additions and 59 deletions

View File

@@ -120,7 +120,7 @@ RSpec.describe SessionController do
expect(response_body_parsed["challenge"]).to eq(
DiscourseWebauthn.challenge(user, secure_session),
)
expect(DiscourseWebauthn.rp_id(user, secure_session)).to eq(Discourse.current_hostname)
expect(DiscourseWebauthn.rp_id).to eq(Discourse.current_hostname)
end
end
end