class Auther::CredentialsGenerator

Credentials generator for new secret, login, and password.

Public Instance Methods

credentials() click to toggle source
# File lib/generators/auther/credentials/credentials_generator.rb, line 7
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
  identity = Cipher.generate login, password

  display identity
end

Private Instance Methods

display(identity) click to toggle source
# File lib/generators/auther/credentials/credentials_generator.rb, line 19
    def display identity
      puts "\n\nHere are your credentials:\n"

      say <<~MESSAGE.gsub(/^/, "  "), :green
        AUTHER_SECRET=#{identity.fetch :secret}
        AUTHER_ADMIN_LOGIN=#{identity.fetch :login}
        AUTHER_ADMIN_PASSWORD=#{identity.fetch :password}
      MESSAGE

      say "\nReminder: Do not add these credentials to source control.", :yellow
    end