Class: Devise::Webauthn::ControllersGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/devise/webauthn/controllers_generator.rb

Constant Summary collapse

CONTROLLERS =
%w[
  passkeys
  second_factor_webauthn_credentials
  two_factor_authentications
  passkey_authentication_options
  passkey_registration_options
  security_key_authentication_options
  security_key_registration_options
].freeze

Instance Method Summary collapse

Instance Method Details

#create_controllersObject



26
27
28
29
30
31
32
33
# File 'lib/generators/devise/webauthn/controllers_generator.rb', line 26

def create_controllers
  @scope_prefix = scope.blank? ? "" : "#{scope.camelize}::"
  controllers = options[:controllers] || CONTROLLERS
  controllers.each do |name|
    template "#{name}_controller.rb",
             "app/controllers/#{scope}/#{name}_controller.rb"
  end
end

#show_readmeObject



35
36
37
# File 'lib/generators/devise/webauthn/controllers_generator.rb', line 35

def show_readme
  readme "README" if behavior == :invoke
end