fix: check whether org exists before creating user (#11647)

# Which Problems Are Solved

It was possible to create a user with an imaginary org.

# How the Problems Are Solved

Check whether org exists before creating the user.

# Additional Changes


# Additional Context

- Closes #11532
This commit is contained in:
Wim Van Laer
2026-03-16 13:12:21 +01:00
committed by GitHub
parent 9a4530bf77
commit 965e3fa621
5 changed files with 352 additions and 42 deletions
+4
View File
@@ -114,6 +114,10 @@ func (c *Commands) AddMachine(ctx context.Context, machine *Machine, state *doma
return nil, err
}
}
err = c.checkOrgExists(ctx, machine.ResourceOwner)
if err != nil {
return nil, err
}
cmds, err := preparation.PrepareCommands(ctx, c.eventstore.Filter, AddMachineCommand(agg, machine))
if err != nil {
return nil, err