Add pre-assume enrolled device status query

The /enroll wait UI polled device state via node(), which
requires an assumed org session, so confirmation never
succeeded for unassumed viewers. Expose viewer.enrolledDevice
behind itam:employee-device:get (own-device, skip assumption)
and point the poller at it.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-07-17 16:54:57 +02:00
parent afe0c84881
commit 238c19d509
8 changed files with 140 additions and 6 deletions

View File

@@ -49,9 +49,8 @@ const enrollDeviceButtonMutation = graphql`
const enrollDeviceButtonStatusQuery = graphql`
query EnrollDeviceButtonStatusQuery($deviceId: ID!) {
device: node(id: $deviceId) {
__typename
... on Device {
viewer @required(action: THROW) {
enrolledDevice(id: $deviceId) {
id
state
hostname
@@ -138,8 +137,8 @@ function EnrollDeviceButtonContent(
return;
}
const device = data?.device;
if (device?.__typename !== "Device") {
const device = data?.viewer.enrolledDevice;
if (device == null) {
if (Date.now() > deadline) {
setIsWaitingForActivity(false);
setHasTimedOut(true);