From 7c289229aeb96c036d0bda0f459b78630c8c7aeb Mon Sep 17 00:00:00 2001 From: Andy Zhao Date: Thu, 11 Mar 2021 21:36:49 -0800 Subject: [PATCH] authhandler: Update default_authhandler.go to inline handler logic --- authhandler/default_authhandler.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/authhandler/default_authhandler.go b/authhandler/default_authhandler.go index 22cb7f8..1989f31 100644 --- a/authhandler/default_authhandler.go +++ b/authhandler/default_authhandler.go @@ -29,14 +29,10 @@ import ( // option.WithTokenSource(tokenSource)) func DefaultAuthorizationHandler(state string) AuthorizationHandler { return func(authCodeURL string) (string, string, error) { - return defaultAuthorizationHandlerHelper(state, authCodeURL) + fmt.Printf("Go to the following link in your browser:\n\n %s\n\n", authCodeURL) + fmt.Println("Enter authorization code: ") + var code string + fmt.Scanln(&code) + return code, state, nil } } - -func defaultAuthorizationHandlerHelper(state string, authCodeURL string) (string, string, error) { - fmt.Printf("Go to the following link in your browser:\n\n %s\n\n", authCodeURL) - fmt.Println("Enter authorization code: ") - var code string - fmt.Scanln(&code) - return code, state, nil -}