rethought the auth system and realized that it was bullshit

This commit is contained in:
Siesta
2025-07-17 22:14:11 +02:00
parent 77120bce29
commit fe9841b4e1
8 changed files with 53 additions and 86 deletions
+3 -2
View File
@@ -19,8 +19,8 @@ func IDtoInt(id string) (int, error) {
if err != nil {
return 0, errors.New("invalid ID format")
}
if idInt < 0 {
return 0, errors.New("ID must not be negative")
if idInt <= 0 {
return 0, errors.New("invalid ID")
}
return idInt, nil
}
@@ -31,6 +31,7 @@ func IsValidHexColor(color string) bool {
return match
}
func GenerateToken() (string, error) {
bytes := make([]byte, 32)
if _, err := rand.Read(bytes); err != nil {