mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-02 09:58:29 +02:00
Add OTP and scopes to login (#546)
Resolves #542 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/546 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: John Olheiser <john+gitea@jolheiser.com> Co-committed-by: John Olheiser <john+gitea@jolheiser.com>
This commit is contained in:

committed by
John Olheiser

parent
d15af88f83
commit
c8c8e9758b
@ -54,6 +54,16 @@ var CmdLoginAdd = cli.Command{
|
||||
EnvVars: []string{"GITEA_SERVER_PASSWORD"},
|
||||
Usage: "Password for basic auth (will create token)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "otp",
|
||||
EnvVars: []string{"GITEA_SERVER_OTP"},
|
||||
Usage: "OTP token for auth, if necessary",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "scopes",
|
||||
EnvVars: []string{"GITEA_SCOPES"},
|
||||
Usage: "Token scopes to add when creating a new token, separated by a comma",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ssh-key",
|
||||
Aliases: []string{"s"},
|
||||
@ -95,6 +105,8 @@ func runLoginAdd(ctx *cli.Context) error {
|
||||
ctx.String("token"),
|
||||
ctx.String("user"),
|
||||
ctx.String("password"),
|
||||
ctx.String("otp"),
|
||||
ctx.String("scopes"),
|
||||
ctx.String("ssh-key"),
|
||||
ctx.String("url"),
|
||||
ctx.String("ssh-agent-principal"),
|
||||
|
Reference in New Issue
Block a user