mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 07:39:16 +00:00
Protect telemetry properties route
This commit is contained in:
parent
141f89f81f
commit
19d88652e3
@ -71,6 +71,8 @@ function App() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const currentToken = auth.getToken();
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
@ -81,10 +83,16 @@ function App() {
|
|||||||
|
|
||||||
updateProjectSettings({ menuLogo: prefixFileUrlWithBackendUrl(menuLogo) });
|
updateProjectSettings({ menuLogo: prefixFileUrlWithBackendUrl(menuLogo) });
|
||||||
|
|
||||||
if (uuid) {
|
if (uuid && currentToken) {
|
||||||
const {
|
const {
|
||||||
data: { data: properties },
|
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);
|
setTelemetryProperties(properties);
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ module.exports = [
|
|||||||
path: '/telemetry-properties',
|
path: '/telemetry-properties',
|
||||||
handler: 'admin.telemetryProperties',
|
handler: 'admin.telemetryProperties',
|
||||||
config: {
|
config: {
|
||||||
auth: false,
|
policies: ['admin::isAuthenticatedAdmin'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user