Modular logistics and supply chain operating system (LSOS)
JavaScript driver-appfleet-managementfreight-managementinfrastructureinventory-managementlast-mile-deliverylogisticsondemandopen-sourceorder-managementroute-optimizationsupply-chain-managementtracking-and-monitoringtransport-management-systemtransportationwarehouse-management
fix(oauth): map the OAuth routes and group sign-in settings under Auth Config
Ronald A. Richardson17fcf4c34c86
diff --git a/console/app/controllers/console/admin.js b/console/app/controllers/console/admin.jsindex aa13f955..d0f25c7d 100644--- a/console/app/controllers/console/admin.js+++ b/console/app/controllers/console/admin.js@@ -8,7 +8,7 @@ export default class ConsoleAdminController extends Controller {@service intl;get navigationItems() {- return [...this.coreNavigationItems, ...this.registryNavigationItems, ...this.registryPanelItems, this.systemConfigNavigationItem];+ return [...this.coreNavigationItems, ...this.registryNavigationItems, ...this.registryPanelItems, this.authConfigNavigationItem, this.systemConfigNavigationItem];}get coreNavigationItems() {@@ -34,13 +34,6 @@ export default class ConsoleAdminController extends Controller {route: 'console.admin.branding',keywords: ['brand', 'logo', 'theme', 'colors'],},- {- label: this.intl.t('console.admin.menu.2fa-config'),- description: 'Configure administrator two-factor authentication policy.',- icon: 'shield-halved',- route: 'console.admin.two-fa-settings',- keywords: ['two factor', '2fa', 'security', 'mfa'],- },{label: this.intl.t('console.admin.menu.platform-api-token'),description: 'Manage the platform API token used by trusted platform integrations.',@@ -75,6 +68,36 @@ export default class ConsoleAdminController extends Controller {});}+ /**+ * How people sign in — kept apart from System Config, which is infrastructure+ * (mail, storage, queues). Grouping only affects the sidebar: each child keeps its+ * own route, so existing links to the 2FA page are unaffected.+ */+ get authConfigNavigationItem() {+ return {+ label: 'Auth Config',+ description: 'Configure how people sign in: OAuth providers and two-factor authentication.',+ icon: 'user-shield',+ keywords: ['auth', 'authentication', 'sign in', 'login', 'security'],+ children: [+ {+ label: this.intl.t('console.admin.menu.oauth'),+ description: 'Configure sign-in with Google, Microsoft, GitHub and Apple.',+ icon: 'right-to-bracket',+ route: 'console.admin.oauth-settings',+ keywords: ['oauth', 'sso', 'sign in', 'login', 'google', 'microsoft', 'github', 'apple'],+ },+ {+ label: this.intl.t('console.admin.menu.2fa-config'),+ description: 'Configure administrator two-factor authentication policy.',+ icon: 'shield-halved',+ route: 'console.admin.two-fa-settings',+ keywords: ['two factor', '2fa', 'security', 'mfa'],+ },+ ],+ };+ }+get systemConfigNavigationItem() {return {label: 'System Config',@@ -117,13 +140,6 @@ export default class ConsoleAdminController extends Controller {route: 'console.admin.config.socket',keywords: ['socket', 'realtime', 'websocket'],},- {- label: this.intl.t('console.admin.menu.oauth'),- description: 'Configure sign-in with Google, Microsoft, GitHub and Apple.',- icon: 'right-to-bracket',- route: 'console.admin.config.oauth',- keywords: ['oauth', 'sso', 'sign in', 'login', 'google', 'microsoft', 'github', 'apple'],- },{label: this.intl.t('console.admin.menu.push-notifications'),description: 'Configure notification channels.',diff --git a/console/app/controllers/console/admin/config/oauth.js b/console/app/controllers/console/admin/config/oauth.jsdeleted file mode 100644index f3e1cd33..00000000--- a/console/app/controllers/console/admin/config/oauth.js+++ /dev/null@@ -1,3 +0,0 @@-import Controller from '@ember/controller';--export default class ConsoleAdminConfigOauthController extends Controller {}diff --git a/console/app/controllers/console/admin/oauth-settings.js b/console/app/controllers/console/admin/oauth-settings.jsnew file mode 100644index 00000000..a7aba50f--- /dev/null+++ b/console/app/controllers/console/admin/oauth-settings.js@@ -0,0 +1,3 @@+import Controller from '@ember/controller';++export default class ConsoleAdminOauthSettingsController extends Controller {}diff --git a/console/app/router.js b/console/app/router.jsindex f46ab32c..53ee0fc5 100644--- a/console/app/router.js+++ b/console/app/router.js@@ -1,21 +1,3 @@-/**- * ███████╗██╗ ███████╗███████╗████████╗██████╗ █████╗ ███████╗███████╗- * ██╔════╝██║ ██╔════╝██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔════╝██╔════╝- * █████╗ ██║ █████╗ █████╗ ██║ ██████╔╝███████║███████╗█████╗- * ██╔══╝ ██║ ██╔══╝ ██╔══╝ ██║ ██╔══██╗██╔══██║╚════██║██╔══╝- * ██║ ███████╗███████╗███████╗ ██║ ██████╔╝██║ ██║███████║███████╗- * ╚═╝ ╚══════╝╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝- *- * AUTO-GENERATED FILE - DO NOT EDIT- *- * This file is automatically generated by the Fleetbase extension build system.- * Any manual changes will be overwritten on the next build.- *- * @generated- * @copyright © 2026 Fleetbase Pte Ltd. All rights reserved.- * @license AGPL-3.0-or-later- */-import EmberRouter from '@ember/routing/router';import config from '@fleetbase/console/config/environment';@@ -69,74 +51,16 @@ Router.map(function () {});this.route('branding');this.route('two-fa-settings');- this.route('platform-api-token');this.route('virtual', { path: '/:slug' });this.route('organizations', function () {- this.route('index', { path: '/' });- this.route('details', { path: '/:public_id' }, function () {- this.route('index', { path: '/' });- this.route('users');- this.route('extensions');- this.route('activity');- this.route('settings');- this.route('extensions-tab', { path: '/extensions/:slug' });+ this.route('index', { path: '/' }, function () {+ this.route('users', { path: '/:public_id/users' });});});this.route('schedule-monitor', function () {this.route('logs', { path: '/:id/logs' });});});-- this.mount('@fleetbase/ai-engine', {- as: 'ai',- path: 'ai'- });-- this.mount('@fleetbase/dev-engine', {- as: 'developers',- path: 'developers'- });-- this.mount('@fleetbase/fleetops-engine', {- as: 'fleet-ops',- path: 'fleet-ops'- });-- this.mount('@fleetbase/iam-engine', {- as: 'iam',- path: 'iam'- });-- this.mount('@fleetbase/ledger-engine', {- as: 'ledger',- path: 'ledger'- });-- this.mount('@fleetbase/storefront-engine', {- as: 'storefront',- path: 'storefront'- });-- this.mount('@fleetbase/registry-bridge-engine', {- as: 'extensions',- path: 'extensions'- });-- this.mount('@fleetbase/valhalla-engine', {- as: 'valhalla',- path: 'valhalla'- });-- this.mount('@fleetbase/vroom-engine', {- as: 'vroom',- path: 'vroom'- });});-- this.mount('@fleetbase/customer-portal-engine', {- as: 'customer-portal',- path: 'customer-portal'- });-this.route('catch', { path: '/*' });});diff --git a/console/app/routes/console/admin/config/oauth.js b/console/app/routes/console/admin/config/oauth.jsdeleted file mode 100644index 1d797d58..00000000--- a/console/app/routes/console/admin/config/oauth.js+++ /dev/null@@ -1,3 +0,0 @@-import Route from '@ember/routing/route';--export default class ConsoleAdminConfigOauthRoute extends Route {}diff --git a/console/app/routes/console/admin/oauth-settings.js b/console/app/routes/console/admin/oauth-settings.jsnew file mode 100644index 00000000..7f4ae0e9--- /dev/null+++ b/console/app/routes/console/admin/oauth-settings.js@@ -0,0 +1,3 @@+import Route from '@ember/routing/route';++export default class ConsoleAdminOauthSettingsRoute extends Route {}diff --git a/console/app/templates/console/admin/config/oauth.hbs b/console/app/templates/console/admin/oauth-settings.hbssimilarity index 100%rename from console/app/templates/console/admin/config/oauth.hbsrename to console/app/templates/console/admin/oauth-settings.hbsdiff --git a/console/router.map.js b/console/router.map.jsindex 9c1c1216..73ba3d7b 100644--- a/console/router.map.js+++ b/console/router.map.js@@ -19,6 +19,7 @@ Router.map(function () {this.route('two-fa');this.route('verification');this.route('portal-login', { path: '/portal' });+ this.route('oauth-callback', { path: '/oauth/callback' });});this.route('invite', { path: 'join' }, function () {this.route('for-driver', { path: '/fleet/:public_id' });@@ -51,6 +52,7 @@ Router.map(function () {});this.route('branding');this.route('two-fa-settings');+ this.route('oauth-settings');this.route('platform-api-token');this.route('virtual', { path: '/:slug' });this.route('organizations', function () {diff --git a/console/tests/unit/controllers/console/admin-test.js b/console/tests/unit/controllers/console/admin-test.jsindex 719d7c67..ec30f622 100644--- a/console/tests/unit/controllers/console/admin-test.js+++ b/console/tests/unit/controllers/console/admin-test.js@@ -60,6 +60,14 @@ class IntlStub extends Service {}}+/**+ * Look a top-level navigator item up by label. Positions shift whenever a core item+ * or group is added, so asserting on an index tests the layout by accident.+ */+function navItem(controller, label) {+ return controller.navigationItems.find((item) => item.label === label);+}+module('Unit | Controller | console/admin', function (hooks) {setupTest(hooks);@@ -98,32 +106,25 @@ module('Unit | Controller | console/admin', function (hooks) {const items = controller.navigationItems;assert.deepEqual(- items.slice(0, 6).map((item) => item.label),- ['Overview', 'Organizations', 'Branding', '2FA Config', 'Platform API Token', 'Schedule Monitor'],+ items.slice(0, 5).map((item) => item.label),+ ['Overview', 'Organizations', 'Branding', 'Platform API Token', 'Schedule Monitor'],'core admin items retain their current order');assert.deepEqual(- items.slice(0, 6).map((item) => item.route),- [- 'console.admin.index',- 'console.admin.organizations',- 'console.admin.branding',- 'console.admin.two-fa-settings',- 'console.admin.platform-api-token',- 'console.admin.schedule-monitor',- ],+ items.slice(0, 5).map((item) => item.route),+ ['console.admin.index', 'console.admin.organizations', 'console.admin.branding', 'console.admin.platform-api-token', 'console.admin.schedule-monitor'],'core admin items retain their routes');assert.deepEqual(- items.slice(0, 6).map((item) => item.icon),- ['rectangle-list', 'building', 'palette', 'shield-halved', 'key', 'calendar-check'],+ items.slice(0, 5).map((item) => item.icon),+ ['rectangle-list', 'building', 'palette', 'key', 'calendar-check'],'core admin items retain their icons');});test('it converts loose registry admin menu items into root navigator items', function (assert) {const controller = this.owner.lookup('controller:console/admin');- const registryItem = controller.navigationItems[6];+ const registryItem = navItem(controller, 'Registry Config');assert.strictEqual(registryItem.label, 'Registry Config');assert.strictEqual(registryItem.icon, 'gear');@@ -137,7 +138,7 @@ module('Unit | Controller | console/admin', function (hooks) {test('it converts registry admin panels into nested navigator branches', function (assert) {const controller = this.owner.lookup('controller:console/admin');- const panel = controller.navigationItems[7];+ const panel = navItem(controller, 'Fleet-Ops Config');assert.strictEqual(panel.label, 'Fleet-Ops Config');assert.strictEqual(panel.icon, 'truck');@@ -162,9 +163,9 @@ module('Unit | Controller | console/admin', function (hooks) {test('it marks virtual registry items active from the current admin virtual URL', function (assert) {const controller = this.owner.lookup('controller:console/admin');- const rootRegistryItem = controller.navigationItems[6];- const navigatorAppItem = controller.navigationItems[7].children[0];- const mapItem = controller.navigationItems[7].children[1];+ const rootRegistryItem = navItem(controller, 'Registry Config');+ const navigatorAppItem = navItem(controller, 'Fleet-Ops Config').children[0];+ const mapItem = navItem(controller, 'Fleet-Ops Config').children[1];// activeWhen delegates to ember-ui's isMenuItemActive, which reads location.pathname// through ember-window-mock — but its collaborator getUrlParam has no such import and@@ -195,8 +196,8 @@ module('Unit | Controller | console/admin', function (hooks) {test('it transitions registry items through the admin virtual route', function (assert) {const controller = this.owner.lookup('controller:console/admin');const universe = this.owner.lookup('service:universe');- const rootRegistryItem = controller.navigationItems[6];- const panelRegistryItem = controller.navigationItems[7].children[0];+ const rootRegistryItem = navItem(controller, 'Registry Config');+ const panelRegistryItem = navItem(controller, 'Fleet-Ops Config').children[0];rootRegistryItem.onClick();panelRegistryItem.onClick();@@ -213,14 +214,37 @@ module('Unit | Controller | console/admin', function (hooks) {assert.true(universe.transitions[1].menuItem._virtual, 'panel registry click passes virtual-enriched item');});+ test('it groups sign-in settings under auth config, beside system config', function (assert) {+ const controller = this.owner.lookup('controller:console/admin');+ const authConfig = navItem(controller, 'Auth Config');+ const labels = controller.navigationItems.map((item) => item.label);++ assert.ok(authConfig, 'the group exists');+ assert.deepEqual(+ authConfig.children.map((item) => item.label),+ ['OAuth Sign-in', '2FA Config'],+ 'sign-in first, then the second factor'+ );+ // Grouping is sidebar-only: 2FA keeps its route, so existing links still work.+ assert.deepEqual(+ authConfig.children.map((item) => item.route),+ ['console.admin.oauth-settings', 'console.admin.two-fa-settings']+ );+ assert.strictEqual(labels.indexOf('Auth Config') + 1, labels.indexOf('System Config'), 'auth config sits just before system config');+ assert.notOk(+ controller.navigationItems.some((item) => item.label === '2FA Config'),+ '2FA is no longer a top-level item'+ );+ });+test('it adds system config as a nested navigator branch', function (assert) {const controller = this.owner.lookup('controller:console/admin');- const systemConfig = controller.navigationItems[8];+ const systemConfig = navItem(controller, 'System Config');assert.strictEqual(systemConfig.label, 'System Config');assert.deepEqual(systemConfig.children.map((item) => item.label),- ['Services', 'Mail', 'Filesystem', 'Queue', 'Socket', 'OAuth Sign-in', 'Push Notifications'],+ ['Services', 'Mail', 'Filesystem', 'Queue', 'Socket', 'Push Notifications'],'system config children retain their current order');assert.deepEqual(@@ -231,7 +255,6 @@ module('Unit | Controller | console/admin', function (hooks) {'console.admin.config.filesystem','console.admin.config.queue','console.admin.config.socket',- 'console.admin.config.oauth','console.admin.config.notification-channels',],'system config children retain their routes'diff --git a/console/tests/unit/router-test.js b/console/tests/unit/router-test.jsnew file mode 100644index 00000000..886ce5cc--- /dev/null+++ b/console/tests/unit/router-test.js@@ -0,0 +1,37 @@+import { module, test } from 'qunit';+import { setupTest } from '@fleetbase/console/tests/helpers';++/**+ * Other tests stub the router or look route classes up directly, so a route that+ * exists as a file but is missing from router.map.js passes everything and only+ * fails in the browser. These assertions run against the real, generated map.+ */+module('Unit | Router', function (hooks) {+ setupTest(hooks);++ // The public router service only resolves names once the app has booted and+ // transitioned; asking the route map directly is the point of this test.+ /* eslint-disable ember/no-private-routing-service */+ function hasRoute(owner, name) {+ const router = owner.lookup('router:main');+ router.setupRouter();+ return router._routerMicrolib.hasRoute(name);+ }+ /* eslint-enable ember/no-private-routing-service */++ test('every route the sign-in flows transition to is mapped', function (assert) {+ ['auth.login', 'auth.oauth-callback', 'auth.two-fa', 'onboard', 'console.account.auth'].forEach((name) => {+ assert.true(hasRoute(this.owner, name), `${name} is in router.map.js`);+ });+ });++ test('every admin navigator item points at a mapped route', function (assert) {+ const controller = this.owner.lookup('controller:console/admin');+ const routes = controller.navigationItems.flatMap((item) => [item.route, ...(item.children ?? []).map((child) => child.route)]).filter(Boolean);++ assert.ok(routes.includes('console.admin.oauth-settings'), 'the OAuth page is in the navigator');+ routes.forEach((name) => {+ assert.true(hasRoute(this.owner, name), `${name} is in router.map.js`);+ });+ });+});