Class: Booth::Models::Credential

Inherits:
ApplicationRecord show all
Includes:
Booth::Models::Concerns::Modeable, Booth::Models::Concerns::Otpable, Booth::Models::Concerns::Passwordable
Defined in:
lib/booth/models/credential.rb

Instance Method Summary collapse

Methods included from Booth::Models::Concerns::Otpable

#authenticate_otp, #otp_provisioning_svg, #otp_provisioning_url

Methods included from Booth::Models::Concerns::Modeable

#allows_mode_username_and_password?, #allows_mode_username_and_webauth?, #allows_mode_username_password_and_otp?, #allows_mode_username_password_and_webauth?, #requires_user_verification?

Instance Method Details

#applicable_for_password_reset?Boolean Also known as: passworded?

Returns:

  • (Boolean)


33
34
35
36
37
# File 'lib/booth/models/credential.rb', line 33

def applicable_for_password_reset?
  mode_username_and_password? ||
    mode_username_password_and_otp? ||
    mode_username_password_and_webauth?
end

#registered_authenticator_idsObject



40
41
42
43
44
# File 'lib/booth/models/credential.rb', line 40

def registered_authenticator_ids
  authenticators.registered_scope
                .sorted_scope
                .pluck(:device_id)
end

#remote_session_available?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/booth/models/credential.rb', line 29

def remote_session_available?
  sessions.active_scope.any?
end