captcha: fix missing images
The captcha library's data struct wasn't being serialized/deserialized fully, meaning the image was never stored. I never really wanted it to be stored anyway, but as a compromise, the invite daemon now deletes captcha images from the DB 20 minutes after generation.
This commit is contained in:
+7
-2
@@ -11,7 +11,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/hrfee/mediabrowser"
|
||||
"github.com/steambap/captcha"
|
||||
"github.com/timshannon/badgerhold/v4"
|
||||
)
|
||||
|
||||
@@ -501,12 +500,18 @@ type Invite struct {
|
||||
Notify map[string]map[string]bool `json:"notify"`
|
||||
Profile string `json:"profile"`
|
||||
Label string `json:"label,omitempty"`
|
||||
Captchas map[string]*captcha.Data // Map of Captcha IDs to answers
|
||||
Captchas map[string]Captcha // Map of Captcha IDs to images & answers
|
||||
IsReferral bool `json:"is_referral" badgerhold:"index"`
|
||||
ReferrerJellyfinID string `json:"referrer_id"`
|
||||
ReferrerTemplateForProfile string
|
||||
}
|
||||
|
||||
type Captcha struct {
|
||||
Answer string
|
||||
Image []byte // image/png
|
||||
Generated time.Time
|
||||
}
|
||||
|
||||
type Lang struct {
|
||||
AdminPath string
|
||||
chosenAdminLang string
|
||||
|
||||
Reference in New Issue
Block a user