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