Skip to content

Commit 38faeab

Browse files
authored
Merge pull request #57 from deadblue/develop
Bump version to 0.7.6.
2 parents b808e4e + 365267a commit 38faeab

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func main() {
2525
agent := elevengo.Default()
2626
// Import credential
2727
credential := &elevengo.Credential{
28-
UID: "", CID: "", SEID: "",
28+
UID: "", CID: "", KID: "", SEID: "",
2929
}
3030
if err := agent.CredentialImport(credential); err != nil {
3131
log.Fatalf("Import credentail error: %s", err)
@@ -66,7 +66,7 @@ func main() {
6666
agent := elevengo.Default()
6767
// Import credential
6868
credential := &elevengo.Credential{
69-
UID: "", CID: "", SEID: "",
69+
UID: "", CID: "", KID: "", SEID: "",
7070
}
7171
if err := agent.CredentialImport(credential); err != nil {
7272
log.Fatalf("Import credentail error: %s", err)

example_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func ExampleAgent_CredentialImport() {
1818
if err := agent.CredentialImport(&Credential{
1919
UID: "UID-From-Cookie",
2020
CID: "CID-From-Cookie",
21+
KID: "KID-From-Cookie",
2122
SEID: "SEID-From-Cookie",
2223
}); err != nil {
2324
log.Fatalf("Import credentail error: %s", err)

internal/protocol/cookie.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const (
88
CookieNameUID = "UID"
99
CookieNameCID = "CID"
1010
CookieNameSEID = "SEID"
11+
CookieNameKID = "KID"
1112
)
1213

1314
var (

login.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import (
99

1010
// Credential contains required information which 115 server uses to
1111
// authenticate a signed-in user.
12-
// In detail, three cookies are required: "UID", "CID", "SEID", caller can
13-
// find them from browser cookie storage.
12+
// In detail, these cookies are required: "UID", "CID", "KID", "SEID".
13+
// Caller can find them from browser cookie storage.
1414
type Credential struct {
1515
UID string
1616
CID string
17+
KID string
1718
SEID string
1819
}
1920

@@ -34,6 +35,9 @@ func (a *Agent) CredentialImport(cr *Credential) (err error) {
3435
protocol.CookieNameCID: cr.CID,
3536
protocol.CookieNameSEID: cr.SEID,
3637
}
38+
if cr.KID != "" {
39+
cookies[protocol.CookieNameKID] = cr.KID
40+
}
3741
a.llc.ImportCookies(cookies, protocol.CookieDomains...)
3842
return a.afterSignIn(cr.UID)
3943
}
@@ -43,6 +47,7 @@ func (a *Agent) CredentialExport(cr *Credential) {
4347
cookies := a.llc.ExportCookies(protocol.CookieUrl)
4448
cr.UID = cookies[protocol.CookieNameUID]
4549
cr.CID = cookies[protocol.CookieNameCID]
50+
cr.KID = cookies[protocol.CookieNameKID]
4651
cr.SEID = cookies[protocol.CookieNameSEID]
4752
}
4853

lowlevel/types/qrcode.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ type QrcodeStatusResult struct {
1414

1515
type QrcodeLoginResult struct {
1616
Cookie struct {
17+
UID string `json:"UID"`
1718
CID string `json:"CID"`
19+
KID string `json:"KID"`
1820
SEID string `json:"SEID"`
19-
UID string `json:"UID"`
2021
} `json:"cookie"`
2122
UserId int `json:"user_id"`
2223
UserName string `json:"user_name"`

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
const (
99
libName = "elevengo"
10-
libVer = "0.7.5"
10+
libVer = "0.7.6"
1111
)
1212

1313
var (

0 commit comments

Comments
 (0)