From dbb98d1e486f3e43b8b77ca7609ec4ebabdb97aa Mon Sep 17 00:00:00 2001 From: John Costa Date: Mon, 14 Apr 2025 09:28:08 +0100 Subject: [PATCH 1/2] feat: making all codes upper case + fetching fixes --- backend/auth.go | 4 +--- backend/models/user.go | 14 +++----------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/backend/auth.go b/backend/auth.go index b3c372d..dacc278 100644 --- a/backend/auth.go +++ b/backend/auth.go @@ -18,7 +18,7 @@ type Auth struct { mailer Mailer } -var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz") +var letterRunes = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ") func randString(n int) string { b := make([]rune, n) @@ -44,7 +44,6 @@ func (a *Auth) CreateCode(email string) error { } func (a *Auth) IsCodeValid(email string, code string) bool { - fmt.Println(a.codes) existingCode, exists := a.codes[email] if !exists { return false @@ -55,7 +54,6 @@ func (a *Auth) IsCodeValid(email string, code string) bool { func (a *Auth) UseCode(email string, code string) error { if valid := a.IsCodeValid(email, code); !valid { - fmt.Println("returning error?") return errors.New("This code is invalid.") } diff --git a/backend/models/user.go b/backend/models/user.go index 80180c1..4a8cae0 100644 --- a/backend/models/user.go +++ b/backend/models/user.go @@ -30,17 +30,9 @@ type ImageWithProperties struct { Text []model.ImageText Locations []model.Locations - - Events []struct { - model.Events - - Location *model.Locations - Organizer *model.Contacts - } - - Notes []model.Notes - - Contacts []model.Contacts + Events []model.Events + Notes []model.Notes + Contacts []model.Contacts } func getUserIdFromImage(ctx context.Context, dbPool *sql.DB, imageId uuid.UUID) (uuid.UUID, error) { From b1b46ff7e58ba02acf78e2d154c9a82240716cda Mon Sep 17 00:00:00 2001 From: John Costa Date: Mon, 14 Apr 2025 09:31:27 +0100 Subject: [PATCH 2/2] fix --- backend/auth.go | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/auth.go b/backend/auth.go index dacc278..ec81b7f 100644 --- a/backend/auth.go +++ b/backend/auth.go @@ -2,7 +2,6 @@ package main import ( "errors" - "fmt" "math/rand" "time" )