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

@@ -167,7 +167,7 @@ module SecondFactorManager
self,
security_key_credential,
challenge: DiscourseWebauthn.challenge(self, secure_session),
rp_id: DiscourseWebauthn.rp_id(self, secure_session),
rp_id: DiscourseWebauthn.rp_id,
origin: Discourse.base_url,
).authenticate_security_key
end