From 6f74ab9db4d885e1743c56e0246d1d7d33ac7cb9 Mon Sep 17 00:00:00 2001 From: Alexander Emelin Date: Mon, 8 Jan 2024 22:03:21 +0200 Subject: [PATCH] rm unused func --- src/utils/Functions.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/utils/Functions.js b/src/utils/Functions.js index b61c060..48244eb 100644 --- a/src/utils/Functions.js +++ b/src/utils/Functions.js @@ -1,8 +1,3 @@ -import { useContext } from 'react' -import { AdminSettingsContext } from 'contexts/AdminSettingsContext' - -import { useAuth } from 'react-oidc-context' - function pad(n) { // http://stackoverflow.com/a/3313953/1288429 return `0${n}`.slice(-2) @@ -80,22 +75,3 @@ export function RandomString(length) { } return result.join('') } - -export function RequestHeaders() { - const adminSettingsContext = useContext(AdminSettingsContext) - const adminSettings = adminSettingsContext.getAdminSettings() - const insecure = adminSettings.insecure - const useIDP = adminSettings.oidc !== undefined - const auth = useAuth() - const headers = { - Accept: 'application/json', - } - if (!insecure) { - if (useIDP) { - headers.Authorization = `Bearer ${auth.user.access_token}` - } else { - headers.Authorization = `token ${localStorage.getItem('token')}` - } - } - return headers -}