aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-08-13 17:54:47 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-08-13 17:54:47 +0200
commitea021df9fa5e91006a4dabdb330f780c7e1e12cf (patch)
tree634a4c55db904dde477b46e0b5e5b5034631f538 /apps
parent3e409fd34208afb69b270076e1f503c10101650a (diff)
downloadnextcloud-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 'apps')
-rw-r--r--apps/comments/src/comments-tab.js4
-rw-r--r--apps/comments/src/services/CommentsInstance.js8
-rw-r--r--apps/dashboard/src/main.js9
-rw-r--r--apps/federatedfilesharing/src/main-admin.js4
-rw-r--r--apps/federatedfilesharing/src/main-personal.js4
-rw-r--r--apps/files/src/main-personal-settings.js4
-rw-r--r--apps/files/src/main.ts7
-rw-r--r--apps/files_sharing/src/files_sharing_tab.js6
-rw-r--r--apps/files_sharing/src/personal-settings.js4
-rw-r--r--apps/settings/src/main-admin-basic-settings.js4
-rw-r--r--apps/settings/src/main-apps-users-management.ts4
-rw-r--r--apps/settings/src/main-personal-info.js4
-rw-r--r--apps/settings/src/main-personal-security.js4
-rw-r--r--apps/settings/src/webpack.shim.d.ts2
-rw-r--r--apps/sharebymail/src/main-admin.js7
-rw-r--r--apps/systemtags/src/admin.ts5
-rw-r--r--apps/theming/src/admin-settings.js4
-rw-r--r--apps/theming/src/personal-settings.js4
-rw-r--r--apps/user_status/src/menu.js7
-rw-r--r--apps/weather_status/src/weather-status.js4
20 files changed, 48 insertions, 51 deletions
diff --git a/apps/comments/src/comments-tab.js b/apps/comments/src/comments-tab.js
index c9b3449e05e..d3ebe3e9596 100644
--- a/apps/comments/src/comments-tab.js
+++ b/apps/comments/src/comments-tab.js
@@ -5,12 +5,12 @@
// eslint-disable-next-line n/no-missing-import, import/no-unresolved
import MessageReplyText from '@mdi/svg/svg/message-reply-text.svg?raw'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { loadState } from '@nextcloud/initial-state'
import { registerCommentsPlugins } from './comments-activity-tab.ts'
// @ts-expect-error __webpack_nonce__ is injected by webpack
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
if (loadState('comments', 'activityEnabled', false) && OCA?.Activity?.registerSidebarAction !== undefined) {
// Do not mount own tab but mount into activity
diff --git a/apps/comments/src/services/CommentsInstance.js b/apps/comments/src/services/CommentsInstance.js
index fccf55814ce..cc45d0cbea7 100644
--- a/apps/comments/src/services/CommentsInstance.js
+++ b/apps/comments/src/services/CommentsInstance.js
@@ -3,16 +3,16 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { translate as t, translatePlural as n } from '@nextcloud/l10n'
-import { getRequestToken } from '@nextcloud/auth'
-import Vue from 'vue'
+import { getCSPNonce } from '@nextcloud/auth'
+import { t, n } from '@nextcloud/l10n'
import { PiniaVuePlugin, createPinia } from 'pinia'
+import Vue from 'vue'
import CommentsApp from '../views/Comments.vue'
import logger from '../logger.js'
Vue.use(PiniaVuePlugin)
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
// Add translates functions
Vue.mixin({
diff --git a/apps/dashboard/src/main.js b/apps/dashboard/src/main.js
index f8b92669197..dac34e07498 100644
--- a/apps/dashboard/src/main.js
+++ b/apps/dashboard/src/main.js
@@ -3,14 +3,15 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import Vue from 'vue'
-import DashboardApp from './DashboardApp.vue'
+import { getCSPNonce } from '@nextcloud/auth'
import { translate as t } from '@nextcloud/l10n'
import VTooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
-import { getRequestToken } from '@nextcloud/auth'
+import Vue from 'vue'
+
+import DashboardApp from './DashboardApp.vue'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.directive('Tooltip', VTooltip)
diff --git a/apps/federatedfilesharing/src/main-admin.js b/apps/federatedfilesharing/src/main-admin.js
index 33eadc0af56..9e3e25fe7cb 100644
--- a/apps/federatedfilesharing/src/main-admin.js
+++ b/apps/federatedfilesharing/src/main-admin.js
@@ -3,13 +3,13 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { translate as t } from '@nextcloud/l10n'
import { loadState } from '@nextcloud/initial-state'
import AdminSettings from './components/AdminSettings.vue'
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.mixin({
methods: {
diff --git a/apps/federatedfilesharing/src/main-personal.js b/apps/federatedfilesharing/src/main-personal.js
index 368c438a7e9..a4ff1e6a669 100644
--- a/apps/federatedfilesharing/src/main-personal.js
+++ b/apps/federatedfilesharing/src/main-personal.js
@@ -3,12 +3,12 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { translate as t } from '@nextcloud/l10n'
import PersonalSettings from './components/PersonalSettings.vue'
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.mixin({
methods: {
diff --git a/apps/files/src/main-personal-settings.js b/apps/files/src/main-personal-settings.js
index c04eb604d3c..63221b3ceb0 100644
--- a/apps/files/src/main-personal-settings.js
+++ b/apps/files/src/main-personal-settings.js
@@ -4,12 +4,12 @@
*/
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import PersonalSettings from './components/PersonalSettings.vue'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.prototype.t = t
diff --git a/apps/files/src/main.ts b/apps/files/src/main.ts
index cac0cf25b6d..7f3f2fe78f5 100644
--- a/apps/files/src/main.ts
+++ b/apps/files/src/main.ts
@@ -2,9 +2,9 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { PiniaVuePlugin } from 'pinia'
+import { getCSPNonce } from '@nextcloud/auth'
import { getNavigation } from '@nextcloud/files'
-import { getRequestToken } from '@nextcloud/auth'
+import { PiniaVuePlugin } from 'pinia'
import Vue from 'vue'
import { pinia } from './store/index.ts'
@@ -14,8 +14,7 @@ import SettingsModel from './models/Setting.js'
import SettingsService from './services/Settings.js'
import FilesApp from './FilesApp.vue'
-// @ts-expect-error __webpack_nonce__ is injected by webpack
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
declare global {
interface Window {
diff --git a/apps/files_sharing/src/files_sharing_tab.js b/apps/files_sharing/src/files_sharing_tab.js
index b7225bc96b8..6afcfa76717 100644
--- a/apps/files_sharing/src/files_sharing_tab.js
+++ b/apps/files_sharing/src/files_sharing_tab.js
@@ -4,8 +4,8 @@
*/
import Vue from 'vue'
-import { translate as t, translatePlural as n } from '@nextcloud/l10n'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
+import { t, n } from '@nextcloud/l10n'
import ShareSearch from './services/ShareSearch.js'
import ExternalLinkActions from './services/ExternalLinkActions.js'
@@ -16,7 +16,7 @@ import TabSections from './services/TabSections.js'
import ShareVariant from '@mdi/svg/svg/share-variant.svg?raw'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
// Init Sharing Tab Service
if (!window.OCA.Sharing) {
diff --git a/apps/files_sharing/src/personal-settings.js b/apps/files_sharing/src/personal-settings.js
index 3f0161b3ce0..e3184f0041e 100644
--- a/apps/files_sharing/src/personal-settings.js
+++ b/apps/files_sharing/src/personal-settings.js
@@ -3,13 +3,13 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+import { getCSPNonce } from '@nextcloud/auth'
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
import PersonalSettings from './components/PersonalSettings.vue'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.prototype.t = t
diff --git a/apps/settings/src/main-admin-basic-settings.js b/apps/settings/src/main-admin-basic-settings.js
index 9be0ab3eaa9..80f9c44a35a 100644
--- a/apps/settings/src/main-admin-basic-settings.js
+++ b/apps/settings/src/main-admin-basic-settings.js
@@ -4,7 +4,7 @@
*/
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { loadState } from '@nextcloud/initial-state'
import { translate as t } from '@nextcloud/l10n'
@@ -13,7 +13,7 @@ import logger from './logger.ts'
import ProfileSettings from './components/BasicSettings/ProfileSettings.vue'
import BackgroundJob from './components/BasicSettings/BackgroundJob.vue'
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
const profileEnabledGlobally = loadState('settings', 'profileEnabledGlobally', true)
diff --git a/apps/settings/src/main-apps-users-management.ts b/apps/settings/src/main-apps-users-management.ts
index 650290cf443..c923406ce7f 100644
--- a/apps/settings/src/main-apps-users-management.ts
+++ b/apps/settings/src/main-apps-users-management.ts
@@ -11,7 +11,7 @@ import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import SettingsApp from './views/SettingsApp.vue'
import router from './router/index.ts'
import { useStore } from './store/index.js'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { PiniaVuePlugin, createPinia } from 'pinia'
Vue.use(VTooltip, { defaultHtml: false })
@@ -21,7 +21,7 @@ sync(store, router)
// CSP config for webpack dynamic chunk loading
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken() ?? '')
+__webpack_nonce__ = getCSPNonce()
// bind to window
Vue.prototype.t = t
diff --git a/apps/settings/src/main-personal-info.js b/apps/settings/src/main-personal-info.js
index 2fe7d97b069..0a1e983c576 100644
--- a/apps/settings/src/main-personal-info.js
+++ b/apps/settings/src/main-personal-info.js
@@ -4,7 +4,7 @@
*/
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { loadState } from '@nextcloud/initial-state'
import { translate as t } from '@nextcloud/l10n'
@@ -28,7 +28,7 @@ import ProfileVisibilitySection from './components/PersonalInfo/ProfileVisibilit
import BirthdaySection from './components/PersonalInfo/BirthdaySection.vue'
import FirstDayOfWeekSection from './components/PersonalInfo/FirstDayOfWeekSection.vue'
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
const profileEnabledGlobally = loadState('settings', 'profileEnabledGlobally', true)
diff --git a/apps/settings/src/main-personal-security.js b/apps/settings/src/main-personal-security.js
index 4582bb0ec5b..583a375fb0e 100644
--- a/apps/settings/src/main-personal-security.js
+++ b/apps/settings/src/main-personal-security.js
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { PiniaVuePlugin, createPinia } from 'pinia'
import VTooltipPlugin from 'v-tooltip'
import Vue from 'vue'
@@ -13,7 +13,7 @@ import AuthTokenSection from './components/AuthTokenSection.vue'
import '@nextcloud/password-confirmation/dist/style.css'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
const pinia = createPinia()
diff --git a/apps/settings/src/webpack.shim.d.ts b/apps/settings/src/webpack.shim.d.ts
index ab01418d29b..3d330bb3128 100644
--- a/apps/settings/src/webpack.shim.d.ts
+++ b/apps/settings/src/webpack.shim.d.ts
@@ -2,4 +2,4 @@
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-declare let __webpack_nonce__: string
+declare let __webpack_nonce__: string | undefined
diff --git a/apps/sharebymail/src/main-admin.js b/apps/sharebymail/src/main-admin.js
index fc0710ea9ad..dd3f6574adf 100644
--- a/apps/sharebymail/src/main-admin.js
+++ b/apps/sharebymail/src/main-admin.js
@@ -3,13 +3,12 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { translate as t } from '@nextcloud/l10n'
-
+import Vue from 'vue'
import AdminSettings from './components/AdminSettings.vue'
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.mixin({
methods: {
diff --git a/apps/systemtags/src/admin.ts b/apps/systemtags/src/admin.ts
index 59b68f23922..892a4cbd169 100644
--- a/apps/systemtags/src/admin.ts
+++ b/apps/systemtags/src/admin.ts
@@ -3,13 +3,12 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+import { getCSPNonce } from '@nextcloud/auth'
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
import SystemTagsSection from './views/SystemTagsSection.vue'
-// @ts-expect-error __webpack_nonce__ is injected by webpack
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
const SystemTagsSectionView = Vue.extend(SystemTagsSection)
new SystemTagsSectionView().$mount('#vue-admin-systemtags')
diff --git a/apps/theming/src/admin-settings.js b/apps/theming/src/admin-settings.js
index d6165ee7453..622837658f9 100644
--- a/apps/theming/src/admin-settings.js
+++ b/apps/theming/src/admin-settings.js
@@ -2,13 +2,13 @@
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import Vue from 'vue'
import App from './AdminTheming.vue'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.prototype.OC = OC
Vue.prototype.t = t
diff --git a/apps/theming/src/personal-settings.js b/apps/theming/src/personal-settings.js
index 15190358c36..bbee88e3804 100644
--- a/apps/theming/src/personal-settings.js
+++ b/apps/theming/src/personal-settings.js
@@ -2,14 +2,14 @@
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import Vue from 'vue'
import { refreshStyles } from './helpers/refreshStyles.js'
import App from './UserTheming.vue'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.prototype.OC = OC
Vue.prototype.t = t
diff --git a/apps/user_status/src/menu.js b/apps/user_status/src/menu.js
index 2e5e9be7e31..34e5e6eabb1 100644
--- a/apps/user_status/src/menu.js
+++ b/apps/user_status/src/menu.js
@@ -3,16 +3,15 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { subscribe } from '@nextcloud/event-bus'
+import Vue from 'vue'
import UserStatus from './UserStatus.vue'
-
import store from './store/index.js'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.prototype.t = t
Vue.prototype.$t = t
diff --git a/apps/weather_status/src/weather-status.js b/apps/weather_status/src/weather-status.js
index 5f6f258da04..45c73b87e4a 100644
--- a/apps/weather_status/src/weather-status.js
+++ b/apps/weather_status/src/weather-status.js
@@ -3,12 +3,12 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+import { getCSPNonce } from '@nextcloud/auth'
import Vue from 'vue'
-import { getRequestToken } from '@nextcloud/auth'
import App from './App.vue'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
Vue.prototype.t = t