lib/faastruby/cli/commands/account/confirm.rb in faastruby-0.5.24 vs lib/faastruby/cli/commands/account/confirm.rb in faastruby-0.5.25

- old
+ new

@@ -12,25 +12,28 @@ end def run user = User.new(email: @options['email']) user.send_confirmation_code + error(errors: user.errors) if user.errors.any? puts "\nYou should have received an email with a confirmation token." puts "If you didn't receive an email:" puts "- Make sure you sign up with the correct email address" puts "- The system won't send an email if you account status is already 'confirmed'" print "Confirmation Token: " user.confirmation_token = STDIN.gets.chomp spinner = spin("Confirming your account...") user.confirm_account! - if user.errors.any? - spinner.error - FaaStRuby::CLI.error(user.errors) - end + error(errors: user.errors) if user.errors.any? spinner.success user.save_credentials puts "Login successful!" migrate + end + + def error(spinner: nil, errors:) + spinner&.error + FaaStRuby::CLI.error(errors) end def migrate old_credentials = File.expand_path("~/.faastruby.tor1") return unless File.file?(old_credentials)