mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-02 09:58:29 +02:00
move git auth prompts to interact module (#276)
move password prompt to interact module closes #231 allow up to 3 ssh key password attempts rename param Co-authored-by: Norwin Roosen <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/276 Reviewed-by: 6543 <6543@obermui.de> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-Authored-By: Norwin <noerw@noreply.gitea.io> Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
16
modules/interact/prompts.go
Normal file
16
modules/interact/prompts.go
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package interact
|
||||
|
||||
import (
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
)
|
||||
|
||||
// PromptPassword asks for a password and blocks until input was made.
|
||||
func PromptPassword(name string) (pass string, err error) {
|
||||
promptPW := &survey.Password{Message: name + " password:"}
|
||||
err = survey.AskOne(promptPW, &pass, survey.WithValidator(survey.Required))
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user