Sha256: 61b8820c462083e3f6109d823533db4c5aa5596d6fcc46282efd26aa5ebc864d

Contents?: true

Size: 776 Bytes

Versions: 28

Compression:

Stored size: 776 Bytes

Contents

module Kontena::Cli::User
  class ResetPasswordCommand < Clamp::Command
    include Kontena::Cli::Common

    parameter "TOKEN", "Password reset token"

    option "--auth-provider-url", "URL", "Auth provider URL", default: "https://auth.kontena.io/"

    def execute
      require 'highline/import'

      password = ask("Password: ") { |q| q.echo = "*" }
      password2 = ask("Password again: ") { |q| q.echo = "*" }
      if password != password2
        abort("Passwords don't match")
      end
      params = {token: token, password: password}
      auth_client = Kontena::Client.new(auth_provider_url)
      auth_client.put('user/password_reset', params)
      puts 'Password is now changed. To login with the new password, please run: kontena login'
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.4 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.3 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.2 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.1 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.0 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.14.7 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.14.6 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.14.5 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.14.4 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.14.3 lib/kontena/cli/user/reset_password_command.rb
kontena-cli-0.14.2 lib/kontena/cli/user/reset_password_command.rb