Class: Auther::CredentialsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Auther::CredentialsGenerator
- Defined in:
- lib/generators/auther/credentials/credentials_generator.rb
Overview
Credentials generator for new secret, login, and password.
Instance Method Summary collapse
-
#credentials ⇒ Object
:reek:TooManyStatements.
Instance Method Details
#credentials ⇒ Object
:reek:TooManyStatements
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/generators/auther/credentials/credentials_generator.rb', line 8 def credentials puts "Welcome to the Auther credentials generator.\n" login = ask " Enter admin login:", echo: false password = ask "\n Enter admin password:", echo: false credentials = Cipher.generate login, password puts "\n\nHere are your credentials:\n" say " AUTHER_SECRET=#{credentials.fetch :secret}\n" \ " AUTHER_ADMIN_LOGIN=#{credentials.fetch :login}\n" \ " AUTHER_ADMIN_PASSWORD=#{credentials.fetch :password}", :green say "\nReminder: Do not add these credentials to source control.", :yellow end |