Class: Auther::CredentialsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/auther/credentials/credentials_generator.rb

Overview

Credentials generator for new secret, login, and password.

Instance Method Summary collapse

Instance Method Details

#credentialsObject

: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"

   = ask "  Enter admin login:", echo: false
  password = ask "\n  Enter admin password:", echo: false
  credentials = Cipher.generate , 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