From d892a9395abd9dae91a2f3be7068f58b0a9489b7 Mon Sep 17 00:00:00 2001 From: Aleksandr Zelenin Date: Tue, 9 Oct 2018 16:06:42 +0300 Subject: [PATCH] authorization fix --- client/authorization.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/client/authorization.go b/client/authorization.go index 421acfd..b8e02ba 100644 --- a/client/authorization.go +++ b/client/authorization.go @@ -111,26 +111,25 @@ func CliInteractor(clientAuthorizer *clientAuthorizer, registration bool) { clientAuthorizer.PhoneNumber <- phoneNumber case TypeAuthorizationStateWaitCode: - fmt.Println("Enter code: ") var code string - fmt.Scanln(&code) + var firstName string + var lastName string - clientAuthorizer.Code <- code + fmt.Println("Enter code: ") + fmt.Scanln(&code) if registration { fmt.Println("Enter first name: ") - var firstName string fmt.Scanln(&firstName) - clientAuthorizer.FirstName <- firstName - fmt.Println("Enter last name: ") - var lastName string fmt.Scanln(&lastName) - - clientAuthorizer.LastName <- lastName } + clientAuthorizer.Code <- code + clientAuthorizer.FirstName <- firstName + clientAuthorizer.LastName <- lastName + case TypeAuthorizationStateReady: return }