From 162aff9c666809eef319dba69c3981f4af7a0610 Mon Sep 17 00:00:00 2001 From: Joshua Herring Date: Wed, 27 May 2026 15:19:28 -0400 Subject: [PATCH] make sure users have an APIKey on create --- dbi/user.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbi/user.go b/dbi/user.go index 9201ed7..8408747 100644 --- a/dbi/user.go +++ b/dbi/user.go @@ -16,6 +16,9 @@ type User struct { } func CreateUser(conn *sql.Conn, user *User) error { + if user.APIKey == "" { + user.APIKey = GenUUID() + } _, err := conn.ExecContext(context.Background(), `INSERT INTO users (APIKey, FirstName, LastName, Password, Status, Username) VALUES (?, ?, ?, ?, ?, ?)`,