Sha256: f84286383ff9cf00d04e0e508fb426c8964fa10fb086dd124b58af556fd73077
Contents?: true
Size: 721 Bytes
Versions: 2
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true require('trailblazer/operation') require('trailblazer/macro') require('console_tracker/authenticators') module ConsoleTracker class Authenticate < Trailblazer::Operation step :user step Nested(:authenticate_operation) fail :close_console pass :success_message def user(_ctx, **) username = STDIN.getpass('Username:') ConsoleTracker.user.name = username end def authenticate_operation(_ctx, **) ConsoleTracker::AUTHENTICATORS[ConsoleTracker.config.authenticator] end def close_console(_ctx, error:, **) abort(error) end def success_message(_ctx, **) puts('You have successfully logged in.') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
console_tracker-0.0.0.pre.beta3 | lib/console_tracker/authenticate.rb |
console_tracker-0.0.0.pre.beta2 | lib/console_tracker/authenticate.rb |