diff options
Diffstat (limited to 'app/models/u2f_registration.rb')
-rw-r--r-- | app/models/u2f_registration.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/app/models/u2f_registration.rb b/app/models/u2f_registration.rb index ba6c1ee6af1..81415eb383b 100644 --- a/app/models/u2f_registration.rb +++ b/app/models/u2f_registration.rb @@ -5,9 +5,6 @@ class U2fRegistration < ApplicationRecord belongs_to :user - after_create :create_webauthn_registration - after_update :update_webauthn_registration, if: :saved_change_to_counter? - def self.register(user, app_id, params, challenges) u2f = U2F::U2F.new(app_id) registration = self.new @@ -43,25 +40,4 @@ class U2fRegistration < ApplicationRecord rescue JSON::ParserError, NoMethodError, ArgumentError, U2F::Error false end - - private - - def create_webauthn_registration - converter = Gitlab::Auth::U2fWebauthnConverter.new(self) - WebauthnRegistration.create!(converter.convert) - rescue StandardError => e - Gitlab::ErrorTracking.track_exception(e, u2f_registration_id: self.id) - end - - def update_webauthn_registration - # When we update the sign count of this registration - # we need to update the sign count of the corresponding webauthn registration - # as well if it exists already - WebauthnRegistration.find_by_credential_xid(webauthn_credential_xid) - &.update_attribute(:counter, counter) - end - - def webauthn_credential_xid - Base64.strict_encode64(Base64.urlsafe_decode64(key_handle)) - end end |