Don't error when an owner is missing

This commit is contained in:
Aaron Bieber 2022-12-21 19:22:22 -07:00
parent 533432ca8b
commit 728f9e1675

6
app.go
View File

@ -28,11 +28,7 @@ func (a *App) getOwner(r *http.Request) (*tailcfg.Node, error) {
ownerID := int64(who.Node.ID) ownerID := int64(who.Node.ID)
ownerExists, err := a.queries.GetOwner(a.ctx, ownerID) ownerExists, err := a.queries.GetOwner(a.ctx, ownerID)
if err != nil { if err != nil || ownerExists.ID != ownerID {
log.Println("owner exists query failed: ", err)
}
if ownerExists.ID != ownerID {
_, err = a.queries.AddOwner(a.ctx, data.AddOwnerParams{ _, err = a.queries.AddOwner(a.ctx, data.AddOwnerParams{
ID: int64(who.Node.ID), ID: int64(who.Node.ID),
Name: who.Node.ComputedName, Name: who.Node.ComputedName,