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();
router.use(assertInit());
router
.get('/network-interface', getNetworkInterface)
.post('/', configStriker)
.put('/set-map-network', setMapNetwork);
.get(
'/network-interface/:hostUUID?',
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;

Loading…
Cancel
Save