Skip to content

Commit

Permalink
tiny changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kqzz committed Aug 23, 2023
1 parent 3f16f59 commit 2dc553b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions cmd/cli/snipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,17 @@ func snipe(username string) error {
authErr := account.MicrosoftAuthenticate()
if authErr != nil {
log.Log("err", "failed to authenticate %v: %v", account.Email, authErr)
time.Sleep(time.Second * 21)
continue
} else {
log.Log("success", "authenticated %s", account.Email)
}

time.Sleep(time.Millisecond * 500)
if account.Type == mc.MsGp {
err := account.License()
if err != nil {
log.Log("err", "failed to license %v: %v", account.Email, err)
licenseErr := account.License()
if licenseErr != nil {
log.Log("err", "failed to license %v: %v", account.Email, licenseErr)
continue
}
usableAccounts = append(usableAccounts, account)
Expand All @@ -124,6 +126,7 @@ func snipe(username string) error {

usableAccounts = append(usableAccounts, account)
}
time.Sleep(time.Second * 21)

}

Expand Down
2 changes: 1 addition & 1 deletion mc/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (account *MCaccount) AuthenticatedReq(method string, url string, body io.Re
return nil, err
}
if account.Bearer == "" {
return nil, errors.New("account is not authenticated")
return nil, errors.New("no bearer detected on account")
}
req.Header.Add("Authorization", "Bearer "+account.Bearer)
req.Header.Set("Content-Type", "application/json")
Expand Down

0 comments on commit 2dc553b

Please sign in to comment.