diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-08-13 17:54:47 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-08-13 17:54:47 +0200 |
commit | ea021df9fa5e91006a4dabdb330f780c7e1e12cf (patch) | |
tree | 634a4c55db904dde477b46e0b5e5b5034631f538 /core/src | |
parent | 3e409fd34208afb69b270076e1f503c10101650a (diff) | |
download | nextcloud-server-ea021df9fa5e91006a4dabdb330f780c7e1e12cf.tar.gz nextcloud-server-ea021df9fa5e91006a4dabdb330f780c7e1e12cf.zip |
chore(deps): Update `@nextcloud/auth` to v2.4.0 and use `getCSPNonce` where possible
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/legacy-unified-search.js | 4 | ||||
-rw-r--r-- | core/src/main.js | 4 | ||||
-rw-r--r-- | core/src/profile.ts | 5 | ||||
-rw-r--r-- | core/src/recommendedapps.js | 4 | ||||
-rw-r--r-- | core/src/unified-search.ts | 4 | ||||
-rw-r--r-- | core/src/unsupported-browser-redirect.js | 4 |
6 files changed, 12 insertions, 13 deletions
diff --git a/core/src/legacy-unified-search.js b/core/src/legacy-unified-search.js index 7916908c04b..59ee462fbf5 100644 --- a/core/src/legacy-unified-search.js +++ b/core/src/legacy-unified-search.js @@ -4,14 +4,14 @@ */ import { getLoggerBuilder } from '@nextcloud/logger' -import { getRequestToken } from '@nextcloud/auth' +import { getCSPNonce } from '@nextcloud/auth' import { translate as t, translatePlural as n } from '@nextcloud/l10n' import Vue from 'vue' import UnifiedSearch from './views/LegacyUnifiedSearch.vue' // eslint-disable-next-line camelcase -__webpack_nonce__ = btoa(getRequestToken()) +__webpack_nonce__ = getCSPNonce() const logger = getLoggerBuilder() .setApp('unified-search') diff --git a/core/src/main.js b/core/src/main.js index e01edf3ec1b..2d88f15562b 100644 --- a/core/src/main.js +++ b/core/src/main.js @@ -14,12 +14,12 @@ import './globals.js' import './jquery/index.js' import { initCore } from './init.js' import { registerAppsSlideToggle } from './OC/apps.js' -import { getRequestToken } from '@nextcloud/auth' +import { getCSPNonce } from '@nextcloud/auth' import { generateUrl } from '@nextcloud/router' import Axios from '@nextcloud/axios' // eslint-disable-next-line camelcase -__webpack_nonce__ = btoa(getRequestToken()) +__webpack_nonce__ = getCSPNonce() window.addEventListener('DOMContentLoaded', function() { initCore() diff --git a/core/src/profile.ts b/core/src/profile.ts index c0ed479c080..454562edb05 100644 --- a/core/src/profile.ts +++ b/core/src/profile.ts @@ -3,14 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { getRequestToken } from '@nextcloud/auth' +import { getCSPNonce } from '@nextcloud/auth' import Vue from 'vue' import Profile from './views/Profile.vue' import ProfileSections from './profile/ProfileSections.js' -// @ts-expect-error Script nonce required for webpack loading additional scripts -__webpack_nonce__ = btoa(getRequestToken() ?? '') +__webpack_nonce__ = getCSPNonce() if (!window.OCA) { window.OCA = {} diff --git a/core/src/recommendedapps.js b/core/src/recommendedapps.js index b7350703f09..13f16436ed3 100644 --- a/core/src/recommendedapps.js +++ b/core/src/recommendedapps.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { getRequestToken } from '@nextcloud/auth' +import { getCSPNonce } from '@nextcloud/auth' import { translate as t } from '@nextcloud/l10n' import Vue from 'vue' @@ -11,7 +11,7 @@ import logger from './logger.js' import RecommendedApps from './components/setup/RecommendedApps.vue' // eslint-disable-next-line camelcase -__webpack_nonce__ = btoa(getRequestToken()) +__webpack_nonce__ = getCSPNonce() Vue.mixin({ methods: { diff --git a/core/src/unified-search.ts b/core/src/unified-search.ts index 95f4c865eaf..fd5f9cb1fdf 100644 --- a/core/src/unified-search.ts +++ b/core/src/unified-search.ts @@ -4,7 +4,7 @@ */ import { getLoggerBuilder } from '@nextcloud/logger' -import { getRequestToken } from '@nextcloud/auth' +import { getCSPNonce } from '@nextcloud/auth' import { translate as t, translatePlural as n } from '@nextcloud/l10n' import { createPinia, PiniaVuePlugin } from 'pinia' import Vue from 'vue' @@ -13,7 +13,7 @@ import UnifiedSearch from './views/UnifiedSearch.vue' import { useSearchStore } from '../src/store/unified-search-external-filters.js' // eslint-disable-next-line camelcase -__webpack_nonce__ = btoa(getRequestToken()) +__webpack_nonce__ = getCSPNonce() const logger = getLoggerBuilder() .setApp('unified-search') diff --git a/core/src/unsupported-browser-redirect.js b/core/src/unsupported-browser-redirect.js index ea4f502127f..64620afa085 100644 --- a/core/src/unsupported-browser-redirect.js +++ b/core/src/unsupported-browser-redirect.js @@ -3,10 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { getRequestToken } from '@nextcloud/auth' +import { getCSPNonce } from '@nextcloud/auth' // eslint-disable-next-line camelcase -__webpack_nonce__ = btoa(getRequestToken()) +__webpack_nonce__ = getCSPNonce() if (!window.TESTING && !OC?.config?.no_unsupported_browser_warning) { window.addEventListener('DOMContentLoaded', async function() { |