Protect telemetry properties route

This commit is contained in:
Christian Capeans 2022-12-07 14:21:58 +01:00
parent 141f89f81f
commit 19d88652e3
2 changed files with 11 additions and 3 deletions

View File

@ -71,6 +71,8 @@ function App() {
}, []);
useEffect(() => {
const currentToken = auth.getToken();
const getData = async () => {
try {
const {
@ -81,10 +83,16 @@ function App() {
updateProjectSettings({ menuLogo: prefixFileUrlWithBackendUrl(menuLogo) });
if (uuid) {
if (uuid && currentToken) {
const {
data: { data: properties },
} = await axios.get(`${strapi.backendURL}/admin/telemetry-properties`);
} = await axios.get(`${strapi.backendURL}/admin/telemetry-properties`, {
headers: {
Authorization: `Bearer ${currentToken}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
});
setTelemetryProperties(properties);

View File

@ -54,7 +54,7 @@ module.exports = [
path: '/telemetry-properties',
handler: 'admin.telemetryProperties',
config: {
auth: false,
policies: ['admin::isAuthenticatedAdmin'],
},
},
{