From 4c3ee1b211c420e7aa6af05a37ec822a1b7fd1e7 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 21 Aug 2023 15:01:05 -0400 Subject: [PATCH] DEV: Remove unused code (#23171) This method slipped in by accident in 10c6b2a and is not used. --- lib/discourse_webauthn.rb | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/lib/discourse_webauthn.rb b/lib/discourse_webauthn.rb index ff3158b2584..800c60931b8 100644 --- a/lib/discourse_webauthn.rb +++ b/lib/discourse_webauthn.rb @@ -81,34 +81,4 @@ module DiscourseWebauthn DiscourseWebauthn::ChallengeGenerator::ChallengeSession.session_challenge_key(user) ] end - - def self.validate_first_factor_key(key) - pp key - webauthn_credential = DiscourseWebauthn::Credential.from_get(key) - p "webauthn_credential" - pp webauthn_credential - - # stored_credential = user.credentials.find_by(webauthn_id: webauthn_credential.id) - - # begin - # webauthn_credential.verify( - # session[:authentication_challenge], - # public_key: stored_credential.public_key, - # sign_count: stored_credential.sign_count - # ) - - # # Update the stored credential sign count with the value from `webauthn_credential.sign_count` - # stored_credential.update!(sign_count: webauthn_credential.sign_count) - - # # Continue with successful sign in or 2FA verification... - - # rescue ::WebAuthn::SignCountVerificationError => e - # # Cryptographic verification of the authenticator data succeeded, but the signature counter was less then or equal - # # to the stored value. This can have several reasons and depending on your risk tolerance you can choose to fail or - # # pass authentication. For more information see https://www.w3.org/TR/webauthn/#sign-counter - # pp e - # rescue ::WebAuthn::Error => e - # # Handle error - # end - end end