Merge branch 'main' of https://git.johncosta.tech/JohnCosta27/Haystack
This commit is contained in:
@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -18,7 +17,7 @@ type Auth struct {
|
|||||||
mailer Mailer
|
mailer Mailer
|
||||||
}
|
}
|
||||||
|
|
||||||
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")
|
var letterRunes = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||||
|
|
||||||
func randString(n int) string {
|
func randString(n int) string {
|
||||||
b := make([]rune, n)
|
b := make([]rune, n)
|
||||||
@ -44,7 +43,6 @@ func (a *Auth) CreateCode(email string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *Auth) IsCodeValid(email string, code string) bool {
|
func (a *Auth) IsCodeValid(email string, code string) bool {
|
||||||
fmt.Println(a.codes)
|
|
||||||
existingCode, exists := a.codes[email]
|
existingCode, exists := a.codes[email]
|
||||||
if !exists {
|
if !exists {
|
||||||
return false
|
return false
|
||||||
@ -55,7 +53,6 @@ func (a *Auth) IsCodeValid(email string, code string) bool {
|
|||||||
|
|
||||||
func (a *Auth) UseCode(email string, code string) error {
|
func (a *Auth) UseCode(email string, code string) error {
|
||||||
if valid := a.IsCodeValid(email, code); !valid {
|
if valid := a.IsCodeValid(email, code); !valid {
|
||||||
fmt.Println("returning error?")
|
|
||||||
return errors.New("This code is invalid.")
|
return errors.New("This code is invalid.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,17 +30,9 @@ type ImageWithProperties struct {
|
|||||||
Text []model.ImageText
|
Text []model.ImageText
|
||||||
|
|
||||||
Locations []model.Locations
|
Locations []model.Locations
|
||||||
|
Events []model.Events
|
||||||
Events []struct {
|
Notes []model.Notes
|
||||||
model.Events
|
Contacts []model.Contacts
|
||||||
|
|
||||||
Location *model.Locations
|
|
||||||
Organizer *model.Contacts
|
|
||||||
}
|
|
||||||
|
|
||||||
Notes []model.Notes
|
|
||||||
|
|
||||||
Contacts []model.Contacts
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getUserIdFromImage(ctx context.Context, dbPool *sql.DB, imageId uuid.UUID) (uuid.UUID, error) {
|
func getUserIdFromImage(ctx context.Context, dbPool *sql.DB, imageId uuid.UUID) (uuid.UUID, error) {
|
||||||
|
Reference in New Issue
Block a user