signup: add reCAPTCHA

can be enabled in settings > captcha, requires a site key & secret key
from google. New wiki article explains getting these. currently a little
ugly looking on the page itself, hopefully fixable.
This commit is contained in:
Harvey Tindall
2023-06-15 17:11:27 +01:00
parent 115f5ae6a3
commit 4014e93155
8 changed files with 335 additions and 199 deletions
+14
View File
@@ -359,3 +359,17 @@ type genCaptchaDTO struct {
type forUserDTO struct {
ID string `json:"id"` // Jellyfin ID
}
// ReCaptchaRequestDTO is sent to /api/siteverify, and includes the identifier of the CAPTCHA data is requested for.
type ReCaptchaRequestDTO struct {
Secret string `json:"secret"`
Response string `json:"response"`
}
// ReCaptchaResponseDTO is returned upon POST to reCAPTCHA /api/siteverify, and gives details upon the use of a CAPTCHA.
type ReCaptchaResponseDTO struct {
Success bool `json:"success"`
ChallengeTimestamp string `json:"challenge_ts"` // ISO yyyy-MM-dd'T'HH:mm:ssZZ
Hostname string `json:"hostname"`
ErrorCodes []string `json:"error-codes"`
}