diff --git a/internal/model/user.go b/internal/model/user.go new file mode 100644 index 0000000..a823efd --- /dev/null +++ b/internal/model/user.go @@ -0,0 +1,17 @@ +package model + +import "time" + +type User struct { + ID string `db:"id"` + Email string `db:"email"` + // Allow null for passwordless users + PasswordHash *string `db:"password_hash"` + PendingEmail *string `db:"pending_email"` + EmailVerifiedAt *time.Time `db:"email_verified_at"` + CreatedAt time.Time `db:"created_at"` +} + +func (u *User) HasPassword() bool { + return u.PasswordHash != nil && *u.PasswordHash != "" +}