mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Cherrypicks https://github.com/fleetdm/fleet/pull/41748 Co-authored-by: Victor Lyuboslavsky <2685025+getvictor@users.noreply.github.com>
This commit is contained in:
parent
127a07997e
commit
402f26e38d
3 changed files with 8 additions and 2 deletions
1
changes/41742-fix-my-device-500-fleet-free
Normal file
1
changes/41742-fix-my-device-500-fleet-free
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Fixed a crash on the "My device" page for Fleet Free instances. The page returned a 402 error when the host was assigned to a team because the device endpoint called a premium-only API, and also crashed when accessing undefined policies data.
|
||||
|
|
@ -674,7 +674,7 @@ const DeviceUserPage = ({
|
|||
);
|
||||
}
|
||||
|
||||
const hasAnyCriticalFailingCAPolicy = host?.policies.some(
|
||||
const hasAnyCriticalFailingCAPolicy = host?.policies?.some(
|
||||
(p) => p.response === "fail" && p.conditional_access_enabled && p.critical
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,12 @@ func getDeviceHostEndpoint(ctx context.Context, request interface{}, svc fleet.S
|
|||
if resp.TeamID != nil {
|
||||
// load the team to get the device's team's software inventory config.
|
||||
tm, err := svc.GetTeam(ctx, *resp.TeamID)
|
||||
if err != nil && !fleet.IsNotFound(err) {
|
||||
if errors.Is(err, fleet.ErrMissingLicense) {
|
||||
// Fleet Free does not support teams, so team-specific config
|
||||
// (software inventory, conditional access, etc.) falls back to
|
||||
// the global defaults set above.
|
||||
tm = nil
|
||||
} else if err != nil && !fleet.IsNotFound(err) {
|
||||
return getDeviceHostResponse{Err: err}, nil
|
||||
}
|
||||
if tm != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue