mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 19:04:38 +00:00
Protect telemetry properties route
This commit is contained in:
parent
141f89f81f
commit
19d88652e3
@ -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);
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ module.exports = [
|
||||
path: '/telemetry-properties',
|
||||
handler: 'admin.telemetryProperties',
|
||||
config: {
|
||||
auth: false,
|
||||
policies: ['admin::isAuthenticatedAdmin'],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user