Skip to content

Commit

Permalink
generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed May 25, 2023
1 parent 3512e01 commit 5c236ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions auth/OpenAiAuth.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

http "github.com/bogdanfinn/fhttp"
tls_client "github.com/bogdanfinn/tls-client"
pkce "github.com/nirasan/go-oauth-pkce-code-verifier"
)

type Error struct {
Expand Down Expand Up @@ -95,9 +96,9 @@ func NewAuthenticator(emailAddress, password, proxy string) *Authenticator {
auth.Session, _ = tls_client.NewHttpClient(tls_client.NewNoopLogger(), options...)

// PKCE
// verifier, _ := pkce.CreateCodeVerifier()
auth.Verifier_code = "yGrXROHx_VazA0uovsxKfE263LMFcrSrdm4SlC-rob8"
auth.Verifier_challenge = "w6n3Ix420Xhhu-Q5-mOOEyuPZmAsJHUbBpO8Ub7xBCY"
verifier, _ := pkce.CreateCodeVerifier()
auth.Verifier_code = verifier.String()
auth.Verifier_challenge = verifier.CodeChallengeS256()

auth.AuthDetails = NewAuthDetails(auth.Verifier_challenge)

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.20
require (
github.com/bogdanfinn/fhttp v0.5.19
github.com/bogdanfinn/tls-client v1.3.8
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/bogdanfinn/utls v1.5.15 h1:XUUMJZh2AptaouuwUrc/RQOYgyV89rstC5Nj3FSP43
github.com/bogdanfinn/utls v1.5.15/go.mod h1:mHeRCi69cUiEyVBkKONB1cAbLjRcZnlJbGzttmiuK4o=
github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c h1:4RYnE0ISVwRxm9Dfo7utw1dh0kdRDEmVYq2MFVLy5zI=
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c/go.mod h1:DvuJJ/w1Y59rG8UTDxsMk5U+UJXJwuvUgbiJSm9yhX8=
github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5 h1:YqAladjX7xpA6BM04leXMWAEjS0mTZ5kUU9KRBriQJc=
github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5/go.mod h1:2JjD2zLQYH5HO74y5+aE3remJQvl6q4Sn6aWA2wD1Ng=
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
Expand Down

0 comments on commit 5c236ce

Please sign in to comment.