Skip to content

Commit

Permalink
lol math
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed May 25, 2023
1 parent 92146e5 commit c3036ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions auth/OpenAiAuth.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ func (auth *Authenticator) partThree(state string) Error {
defer resp.Body.Close()

if resp.StatusCode == 302 || resp.StatusCode == 200 {
return auth.partFive(state)
return auth.partFour(state)
} else {
err := NewError("__part_four", resp.StatusCode, "Your email address is invalid.", fmt.Errorf("error: Check details"))
return *err
}

}
func (auth *Authenticator) partFive(state string) Error {
func (auth *Authenticator) partFour(state string) Error {

url := fmt.Sprintf("https://auth0.openai.com/u/login/password?state=%s", state)
emailURLEncoded := auth.URLEncode(auth.EmailAddress)
Expand Down Expand Up @@ -294,7 +294,7 @@ func (auth *Authenticator) partFive(state string) Error {

if resp.StatusCode == 302 {
redirectURL := resp.Header.Get("Location")
return auth.partSix(state, redirectURL)
return auth.partFive(state, redirectURL)
} else {
body := bytes.NewBuffer(nil)
_, err1 := body.ReadFrom(resp.Body)
Expand All @@ -306,7 +306,7 @@ func (auth *Authenticator) partFive(state string) Error {
}

}
func (auth *Authenticator) partSix(oldState string, redirectURL string) Error {
func (auth *Authenticator) partFive(oldState string, redirectURL string) Error {

url := "https://auth0.openai.com" + redirectURL

Expand Down

0 comments on commit c3036ad

Please sign in to comment.