This commit is contained in:
Simon Ser 2019-12-09 12:27:16 +01:00
parent 135281c48a
commit 897ec17f53
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 11 additions and 11 deletions

View File

@ -28,8 +28,8 @@ import (
func newClient() *protonmail.Client {
return &protonmail.Client{
RootURL: "https://mail.protonmail.com/api",
AppVersion: "Web_3.16.6",
RootURL: "https://mail.protonmail.com/api",
AppVersion: "Web_3.16.6",
}
}
@ -209,10 +209,10 @@ func main() {
}
err = auth.EncryptAndSave(&auth.CachedAuth{
Auth: *a,
LoginPassword: loginPassword,
Auth: *a,
LoginPassword: loginPassword,
MailboxPassword: mailboxPassword,
KeySalts: keySalts,
KeySalts: keySalts,
}, username, secretKey)
if err != nil {
log.Fatal(err)

View File

@ -12,7 +12,7 @@ import (
)
type authInfoReq struct {
Username string
Username string
}
type AuthInfo struct {
@ -45,7 +45,7 @@ func (resp *AuthInfoResp) authInfo() *AuthInfo {
func (c *Client) AuthInfo(username string) (*AuthInfo, error) {
reqData := &authInfoReq{
Username: username,
Username: username,
}
req, err := c.newJSONRequest(http.MethodPost, "/auth/info", reqData)
@ -84,10 +84,10 @@ type Auth struct {
UserID string
EventID string
PasswordMode PasswordMode
TwoFactor struct {
TwoFactor struct {
Enabled int
U2F interface{} // TODO
TOTP int
U2F interface{} // TODO
TOTP int
} `json:"2FA"`
}
@ -212,7 +212,7 @@ func (c *Client) ListKeySalts() (map[string][]byte, error) {
var respData struct {
resp
KeySalts []struct {
ID string
ID string
KeySalt string
}
}