Skip to content

Commit

Permalink
fix: pwd checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Oct 26, 2023
1 parent f54544d commit bb71eb7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package solarman

import (
"context"
"crypto/sha256"
"encoding/json"
"fmt"
"io"
Expand All @@ -20,7 +21,10 @@ type Client struct {
}

func New(appID, appSecret, email, password string) (*Client, error) {
t, err := newOauthToken(appID, appSecret, email, password)
t, err := newOauthToken(
appID, appSecret, email,
fmt.Sprintf("%x", sha256.Sum256([]byte(password))),
)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit bb71eb7

Please sign in to comment.