dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

tableCaptchaRequests.go (538B)


      1 package database
      2 
      3 import (
      4 	"time"
      5 
      6 	"github.com/sirupsen/logrus"
      7 )
      8 
      9 type CaptchaRequest struct {
     10 	ID         int64
     11 	UserID     UserID
     12 	CaptchaImg string
     13 	Answer     string
     14 	CreatedAt  time.Time
     15 	User       User // User object for association queries
     16 }
     17 
     18 //func (r CaptchaRequest) CaptchaImgB64() string {
     19 //	return base64.StdEncoding.EncodeToString(r.CaptchaImg)
     20 //}
     21 
     22 func (d *DkfDB) DeleteOldCaptchaRequests() {
     23 	if err := d.db.Delete(CaptchaRequest{}, "created_at < date('now', '-90 Day')").Error; err != nil {
     24 		logrus.Error(err)
     25 	}
     26 }