fix(striker-ui-api): redirect /init/* to protected endpoints post striker init

main
Tsu-ba-me 2 years ago
parent 8403d7315b
commit d64ad303e8
  1. 26
      striker-ui-api/src/routes/init.ts

@ -8,11 +8,27 @@ import { getNetworkInterface } from '../lib/request_handlers/network-interface';
const router = express.Router(); const router = express.Router();
router.use(assertInit());
router router
.get('/network-interface', getNetworkInterface) .get(
.post('/', configStriker) '/network-interface/:hostUUID?',
.put('/set-map-network', setMapNetwork); assertInit({
fail: ({ path }, response) => response.redirect(`/api${path}`),
}),
getNetworkInterface,
)
.post(
'/',
assertInit({
fail: (request, response) => response.redirect(`/api/host`),
}),
configStriker,
)
.put(
'/set-map-network',
assertInit({
fail: ({ path }, response) => response.redirect(`/api/command${path}`),
}),
setMapNetwork,
);
export default router; export default router;

Loading…
Cancel
Save