This commit is contained in:
gr
2026-09-28 14:18:12 +08:00
parent 49fc974421
commit 694c83dc7d
7 changed files with 80 additions and 3 deletions
@@ -90,8 +90,15 @@ namespace {
desktopCheck($invoke($valid)['data']['root'] === true, 'root comes from current account');
Admin::$row['root'] = 0;
desktopCheck($result['data']['terminal'] === 7, 'desktop token reports the desktop terminal');
$mobile = $invoke(array_replace($valid, ['terminal' => 8]));
desktopCheck($mobile['code'] === 1, 'mobile console token (terminal 8) is accepted');
desktopCheck($mobile['data']['terminal'] === 8, 'mobile console token reports terminal 8');
desktopCheck($mobile['data']['user_id'] === 'admin:9', 'mobile console maps to the same tenant identity');
desktopCheck($invoke([])['code'] === 0, 'missing or expired cached identity rejected');
desktopCheck($invoke(array_replace($valid, ['terminal' => 1]))['code'] === 0, 'web token rejected');
desktopCheck($invoke(array_replace($valid, ['terminal' => 2]))['code'] === 0, 'admin mobile web token rejected');
Admin::$row['disable'] = 1;
desktopCheck($invoke($valid)['code'] === 0, 'disabled account rejected');
Admin::$row = [];