Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
captcha success
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jun 30, 2023
1 parent 5f9d9b3 commit 81726b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 12 additions & 1 deletion captcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ func captchaStart(c *gin.Context) {
c.JSON(500, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusNetworkAuthenticationRequired, gin.H{"token": token, "session": session, "status": "captcha"})
// Get form data (check if download_images is true)
download_images := c.Query("download_images")
var images []string
if download_images == "true" {
// Get Base64 encoded image
images, err = funcaptcha.DownloadChallenge(session.ConciseChallenge.URLs, true)
if err != nil {
c.JSON(500, gin.H{"error": err.Error()})
return
}
}
c.JSON(http.StatusNetworkAuthenticationRequired, gin.H{"token": token, "session": session, "status": "captcha", "images": images})
}

func captchaVerify(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/acheong08/OpenAIAuth v0.0.0-20230530050836-f2a06cd52911
github.com/acheong08/endless v0.0.0-20230529075213-74050cf641c8
github.com/acheong08/funcaptcha v0.2.1-0.20230630144406-9ea6dc9f0cb5
github.com/acheong08/funcaptcha v0.2.1-0.20230630145745-51cc6ac9a96f
github.com/bogdanfinn/fhttp v0.5.23
github.com/bogdanfinn/tls-client v1.4.0
github.com/gin-gonic/gin v1.9.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ github.com/acheong08/funcaptcha v0.2.1-0.20230630142159-995a408a9719 h1:rO0AtqUa
github.com/acheong08/funcaptcha v0.2.1-0.20230630142159-995a408a9719/go.mod h1:VupbjtVAODvgyAB3Zo86fOA53G+UAmaV/Rk9jUCGuTU=
github.com/acheong08/funcaptcha v0.2.1-0.20230630144406-9ea6dc9f0cb5 h1:wP+zQ+QVaAuH2uLasVvwzdHG1LCmq67AmOhbO7dzsXA=
github.com/acheong08/funcaptcha v0.2.1-0.20230630144406-9ea6dc9f0cb5/go.mod h1:VupbjtVAODvgyAB3Zo86fOA53G+UAmaV/Rk9jUCGuTU=
github.com/acheong08/funcaptcha v0.2.1-0.20230630145745-51cc6ac9a96f h1:uMHN8VOKu/BCGlJCxZX43Ibq+fdfsiRdtD/OFnSiHfI=
github.com/acheong08/funcaptcha v0.2.1-0.20230630145745-51cc6ac9a96f/go.mod h1:VupbjtVAODvgyAB3Zo86fOA53G+UAmaV/Rk9jUCGuTU=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/bogdanfinn/fhttp v0.5.23 h1:4Xb5OjYArB8GpnUw4A4r5jmt8UW0/Cvey3R9nS2dC9U=
Expand Down

0 comments on commit 81726b5

Please sign in to comment.