Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference UserWebauthnMethods into UserMultifactorMethods [3/4] #3808

Merged
merged 2 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/models/concerns/user_multifactor_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module UserMultifactorMethods

included do
include UserTotpMethods
include UserWebauthnMethods

enum mfa_level: { disabled: 0, ui_only: 1, ui_and_api: 2, ui_and_gem_signin: 3 }, _prefix: :mfa

Expand Down Expand Up @@ -62,10 +63,6 @@ def mfa_required?

rubygems.mfa_required.any?
end

def verify_webauthn_otp(otp)
webauthn_verification&.verify_otp(otp)
end
end

class_methods do
Expand Down
6 changes: 6 additions & 0 deletions app/models/concerns/user_webauthn_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ def refresh_webauthn_verification
user_id: id
)
end

private

def verify_webauthn_otp(otp)
webauthn_verification&.verify_otp(otp)
end
end
1 change: 0 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class User < ApplicationRecord
include UserMultifactorMethods
include UserWebauthnMethods
include Clearance::User
include Gravtastic
is_gravtastic default: "retro"
Expand Down