forked from Mirrors/oauth2
authhandler: Update default_authhandler.go to inline handler logic
This commit is contained in:
parent
cde11fb840
commit
7c289229ae
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue