feat: making all codes upper case + fetching fixes

This commit is contained in:
2025-04-14 09:28:08 +01:00
parent cd5dd347d3
commit 30143019d6
2 changed files with 4 additions and 14 deletions

View File

@ -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.")
}

View File

@ -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) {