mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Refactor webauthn to support passkeys (1/3) (#23586)
This is part 1 of 3, split up of PR #23529. This PR refactors the webauthn code to support passkey authentication/registration. Passkeys aren't used yet, that is coming in PRs 2 and 3. Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
This commit is contained in:
@@ -163,12 +163,11 @@ module SecondFactorManager
|
||||
end
|
||||
|
||||
def authenticate_security_key(secure_session, security_key_credential)
|
||||
::DiscourseWebauthn::SecurityKeyAuthenticationService.new(
|
||||
::DiscourseWebauthn::AuthenticationService.new(
|
||||
self,
|
||||
security_key_credential,
|
||||
challenge: DiscourseWebauthn.challenge(self, secure_session),
|
||||
rp_id: DiscourseWebauthn.rp_id,
|
||||
origin: Discourse.base_url,
|
||||
session: secure_session,
|
||||
factor_type: UserSecurityKey.factor_types[:second_factor],
|
||||
).authenticate_security_key
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user