Remove captcha on registration page
This commit is contained in:
12
go.mod
12
go.mod
@@ -10,21 +10,21 @@ replace (
|
|||||||
require (
|
require (
|
||||||
fornaxian.tech/config v0.0.0-20211108212237-6133aed90586
|
fornaxian.tech/config v0.0.0-20211108212237-6133aed90586
|
||||||
fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640
|
fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640
|
||||||
fornaxian.tech/pixeldrain_api_client v0.0.0-20241227104508-325e8d73563d
|
fornaxian.tech/pixeldrain_api_client v0.0.0-20250320183604-3264fc9655c2
|
||||||
fornaxian.tech/util v0.0.0-20241206112957-686faddd607f
|
fornaxian.tech/util v0.0.0-20250313124813-fd980f174f1d
|
||||||
github.com/julienschmidt/httprouter v1.3.0
|
github.com/julienschmidt/httprouter v1.3.0
|
||||||
github.com/microcosm-cc/bluemonday v1.0.27
|
github.com/microcosm-cc/bluemonday v1.0.27
|
||||||
github.com/russross/blackfriday/v2 v2.1.0
|
github.com/russross/blackfriday/v2 v2.1.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
github.com/BurntSushi/toml v1.5.0 // indirect
|
||||||
github.com/aymerick/douceur v0.2.0 // indirect
|
github.com/aymerick/douceur v0.2.0 // indirect
|
||||||
github.com/gocql/gocql v1.7.0 // indirect
|
github.com/gocql/gocql v1.7.0 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v1.0.0 // indirect
|
||||||
github.com/gorilla/css v1.0.1 // indirect
|
github.com/gorilla/css v1.0.1 // indirect
|
||||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
|
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
|
||||||
golang.org/x/crypto v0.33.0 // indirect
|
golang.org/x/crypto v0.36.0 // indirect
|
||||||
golang.org/x/net v0.35.0 // indirect
|
golang.org/x/net v0.37.0 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
)
|
)
|
||||||
|
14
go.sum
14
go.sum
@@ -4,6 +4,8 @@ fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640 h1:UPDxJwLRCfh/cv80UMSanzm
|
|||||||
fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640/go.mod h1:sN82qMToeHhP2u3ehvrcE8y1IudRZJAZO9yG5OBYblo=
|
fornaxian.tech/log v0.0.0-20211102185326-552e9b1f8640/go.mod h1:sN82qMToeHhP2u3ehvrcE8y1IudRZJAZO9yG5OBYblo=
|
||||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
|
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
||||||
|
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
||||||
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
|
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
|
||||||
github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY=
|
github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY=
|
||||||
@@ -16,6 +18,8 @@ github.com/gocql/gocql v1.7.0/go.mod h1:vnlvXyFZeLBF0Wy+RS8hrOdbn0UWsWtdg07XJnFx
|
|||||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
|
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||||
|
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
|
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
|
||||||
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
|
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
|
||||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
|
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
|
||||||
@@ -34,13 +38,11 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf
|
|||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
|
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||||
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
|
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||||
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
|
||||||
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
|
||||||
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
|
|
||||||
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
|
|
||||||
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
||||||
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
||||||
|
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
|
||||||
|
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||||
|
@@ -46,11 +46,6 @@ let form = {
|
|||||||
form.append("username", fields.username)
|
form.append("username", fields.username)
|
||||||
form.append("email", fields.email)
|
form.append("email", fields.email)
|
||||||
form.append("password", fields.password)
|
form.append("password", fields.password)
|
||||||
if (fields.recaptcha_response) {
|
|
||||||
console.log("resp", fields.recaptcha_response)
|
|
||||||
form.append("recaptcha_response", fields.recaptcha_response)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const resp = await fetch(
|
const resp = await fetch(
|
||||||
window.api_endpoint+"/user/register",
|
window.api_endpoint+"/user/register",
|
||||||
@@ -82,28 +77,6 @@ let form = {
|
|||||||
return {success: true, message: "Successfully registered a new account"}
|
return {success: true, message: "Successfully registered a new account"}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
|
||||||
const resp = await fetch(window.api_endpoint+"/misc/recaptcha");
|
|
||||||
if(resp.status >= 400) {
|
|
||||||
alert("Failed to get captcha key: " + await resp.text())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let jresp = await resp.json()
|
|
||||||
|
|
||||||
form.fields.push({
|
|
||||||
name: "recaptcha_response",
|
|
||||||
label: "Captcha",
|
|
||||||
type: "captcha",
|
|
||||||
captcha_site_key: jresp.site_key,
|
|
||||||
description: "The reCaptcha test verifies that you " +
|
|
||||||
"are not an evil robot that is trying to flood the " +
|
|
||||||
"website with fake accounts. Please click the white box " +
|
|
||||||
"to prove that you're not a robot"
|
|
||||||
})
|
|
||||||
form.fields = form.fields
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Form config={form}></Form>
|
<Form config={form}></Form>
|
||||||
|
@@ -2,5 +2,8 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"target": "ES2017",
|
"target": "ES2017",
|
||||||
}
|
},
|
||||||
|
"exclude": [
|
||||||
|
"./node_modules/**"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@@ -118,15 +118,6 @@ func (wc *WebController) registerForm(td *TemplateData, r *http.Request) (f Form
|
|||||||
"can verify that no typing errors were made, which would " +
|
"can verify that no typing errors were made, which would " +
|
||||||
"prevent you from logging into your new account",
|
"prevent you from logging into your new account",
|
||||||
Type: FieldTypeNewPassword,
|
Type: FieldTypeNewPassword,
|
||||||
}, {
|
|
||||||
Name: "recaptcha_response",
|
|
||||||
Label: "reCaptcha",
|
|
||||||
Description: "the reCaptcha turing test verifies that you " +
|
|
||||||
"are not an evil robot that is trying to flood the " +
|
|
||||||
"website with fake accounts. Please click the white box " +
|
|
||||||
"to prove that you're not a robot",
|
|
||||||
Type: FieldTypeCaptcha,
|
|
||||||
CaptchaSiteKey: wc.captchaKey(),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
SubmitLabel: "Register",
|
SubmitLabel: "Register",
|
||||||
@@ -139,14 +130,12 @@ func (wc *WebController) registerForm(td *TemplateData, r *http.Request) (f Form
|
|||||||
"password in both password fields"}
|
"password in both password fields"}
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
log.Debug("capt: %s", f.FieldVal("recaptcha_response"))
|
|
||||||
|
|
||||||
// Register the user
|
// Register the user
|
||||||
if err = td.PixelAPI.UserRegister(
|
if err = td.PixelAPI.UserRegister(
|
||||||
f.FieldVal("username"),
|
f.FieldVal("username"),
|
||||||
f.FieldVal("email"),
|
f.FieldVal("email"),
|
||||||
f.FieldVal("password"),
|
f.FieldVal("password"),
|
||||||
f.FieldVal("recaptcha_response"),
|
|
||||||
); err != nil {
|
); err != nil {
|
||||||
formAPIError(err, &f)
|
formAPIError(err, &f)
|
||||||
return f
|
return f
|
||||||
|
@@ -169,18 +169,18 @@ func New(r *httprouter.Router, prefix string, conf Config) (wc *WebController) {
|
|||||||
{GET, "user/export/lists" /**/, wc.serveUserExportLists},
|
{GET, "user/export/lists" /**/, wc.serveUserExportLists},
|
||||||
|
|
||||||
// User account settings
|
// User account settings
|
||||||
{GET, "user" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/home" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/home" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/settings" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/settings" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/sharing" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/sharing" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/sharing/*p" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/sharing/*p" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/api_keys" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/api_keys" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/activity" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/activity" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/connect_app" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/connect_app" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/transactions" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/transactions" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/subscription" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/subscription" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/prepaid" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/prepaid" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/prepaid/*p" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true})},
|
{GET, "user/prepaid/*p" /* */, wc.serveTemplate("user_home", handlerOpts{Auth: true, NoEmbed: true})},
|
||||||
{GET, "user/confirm_email" /* */, wc.serveEmailConfirm},
|
{GET, "user/confirm_email" /* */, wc.serveEmailConfirm},
|
||||||
{GET, "user/password_reset_confirm" /**/, wc.serveForm(wc.passwordResetConfirmForm, handlerOpts{NoEmbed: true})},
|
{GET, "user/password_reset_confirm" /**/, wc.serveForm(wc.passwordResetConfirmForm, handlerOpts{NoEmbed: true})},
|
||||||
{PST, "user/password_reset_confirm" /**/, wc.serveForm(wc.passwordResetConfirmForm, handlerOpts{NoEmbed: true})},
|
{PST, "user/password_reset_confirm" /**/, wc.serveForm(wc.passwordResetConfirmForm, handlerOpts{NoEmbed: true})},
|
||||||
|
Reference in New Issue
Block a user