class Auther::CredentialsGenerator

Credentials generator for new secret, login, and password.

Public Instance Methods

credentials() click to toggle source

:reek: TooManyStatements

# 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