Skip to content

Commit

Permalink
added 2fa support
Browse files Browse the repository at this point in the history
  • Loading branch information
JensvandeWiel committed Oct 27, 2023
1 parent 0c0e7a2 commit c6be007
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/install-rustserver-linux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func main() {

prompts := []*gosteamcmd.Prompt{
gosteamcmd.ForceInstallDir("/home/jens/rustserver"),
gosteamcmd.Login("", ""),
gosteamcmd.Login("", "", ""),
gosteamcmd.AppUpdate(258550, "", true),
}

Expand Down
4 changes: 2 additions & 2 deletions examples/install-rustserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ func main() {

prompts := []*gosteamcmd.Prompt{
gosteamcmd.ForceInstallDir("c:\\rustserver\\"),
gosteamcmd.Login("", ""),
gosteamcmd.AppUpdate(258550, "", true),
gosteamcmd.Login("", "", ""),
gosteamcmd.AppUpdate(2430930, "", true),
}

cmd := gosteamcmd.New(os.Stdout, prompts, "")
Expand Down
6 changes: 3 additions & 3 deletions prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ func AppUpdate(appID int, beta string, validate bool) *Prompt {
return &Prompt{cmd, AppUpdatePrompt}
}

// Login logs into SteamCMD with the given username and password. If the arguments are empty, it will login as anonymous.
func Login(username string, password string) *Prompt {
// Login logs into SteamCMD with the given username and password. If the arguments are empty strings, it will login as anonymous.
func Login(username string, password string, authcode string) *Prompt {
cmd := "login "
if username != "" {
cmd += username + " " + password
cmd += username + " " + password + " " + authcode
} else {
cmd += "anonymous"
}
Expand Down

0 comments on commit c6be007

Please sign in to comment.