1
0
mirror of https://gitea.com/Sirherobrine23/tea.git synced 2024-07-07 09:15:52 -03:00
tea/modules/interact/prompts.go
Norwin d0e05e8be2 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>
2020-12-08 09:21:05 +08:00

17 lines
507 B
Go

// 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
}