Sha256: 82fc91343a8a62ab70707097eeb5d1c6b9a8851a8b2a5e2f3dbfcef63f2cc02c

Contents?: true

Size: 874 Bytes

Versions: 1

Compression:

Stored size: 874 Bytes

Contents

# frozen_string_literal: true

module Auther
  # Credentials generator for new secret, login, and password.
  class CredentialsGenerator < ::Rails::Generators::Base
    desc "Generate Auther secret, login, and password credentials."
    # :reek:TooManyStatements
    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
auther-9.2.0 lib/generators/auther/credentials/credentials_generator.rb