Skip to content

Commit

Permalink
print cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Apr 28, 2023
1 parent 45d9d78 commit 8d436a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auth/OpenAiAuth.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ func (auth *Authenticator) partSix(oldState string, redirectURL string) Error {

if resp.StatusCode == 302 {
auth.URL = resp.Header.Get("Location")
println(auth.URL)
return Error{}
} else {
err := NewError("__part_six", resp.StatusCode, resp.Status, fmt.Errorf("error: Check details"))
Expand All @@ -388,5 +387,9 @@ func (auth *Authenticator) partSix(oldState string, redirectURL string) Error {

}
func (auth *Authenticator) GetAccessToken() (string, Error) {
// Print all cookies
for _, cookie := range auth.Session.GetCookies(&url.URL{Host: "openai.com"}) {
fmt.Printf(" %s: %s\n", cookie.Name, cookie.Value)
}
return auth.URL, Error{}
}

0 comments on commit 8d436a1

Please sign in to comment.