Skip to content

Commit 47734c2

Browse files
committed
fix: adjust webpack nonce generation
some leftovers where the request token is used instead of the CSP nonce. in general this makes not much difference - but there are some cases where those values differ. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 1e8870e commit 47734c2

6 files changed

Lines changed: 14 additions & 12 deletions

File tree

apps/files_sharing/src/additionalScripts.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5+
import { getCSPNonce } from '@nextcloud/auth'
56

67
import './share.js'
78
import './sharebreadcrumbview.js'
89
import './style/sharebreadcrumb.scss'
910
import './collaborationresourceshandler.js'
1011

1112
// eslint-disable-next-line camelcase
12-
__webpack_nonce__ = btoa(OC.requestToken)
13+
__webpack_nonce__ = getCSPNonce()
1314

1415
window.OCA.Sharing = OCA.Sharing

apps/files_sharing/src/collaborationresourceshandler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5+
import { getCSPNonce } from '@nextcloud/auth'
56

67
// eslint-disable-next-line camelcase
7-
__webpack_nonce__ = btoa(OC.requestToken)
8+
__webpack_nonce__ = getCSPNonce()
89

910
window.OCP.Collaboration.registerType('file', {
1011
action: () => {

apps/settings/src/main-admin-ai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5-
5+
import { getCSPNonce } from '@nextcloud/auth'
66
import Vue from 'vue'
77

88
import ArtificialIntelligence from './components/AdminAI.vue'
99

1010
// eslint-disable-next-line camelcase
11-
__webpack_nonce__ = btoa(OC.requestToken)
11+
__webpack_nonce__ = getCSPNonce()
1212

1313
Vue.prototype.t = t
1414

apps/settings/src/main-admin-security.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5-
5+
import { getCSPNonce } from '@nextcloud/auth'
66
import { loadState } from '@nextcloud/initial-state'
77
import Vue from 'vue'
88

@@ -11,7 +11,7 @@ import EncryptionSettings from './components/Encryption/EncryptionSettings.vue'
1111
import store from './store/admin-security.js'
1212

1313
// eslint-disable-next-line camelcase
14-
__webpack_nonce__ = btoa(OC.requestToken)
14+
__webpack_nonce__ = getCSPNonce()
1515

1616
Vue.prototype.t = t
1717

apps/settings/src/main-personal-password.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5+
import { getCSPNonce } from '@nextcloud/auth'
6+
import { t, n } from '@nextcloud/l10n'
57

68
import Vue from 'vue'
7-
89
import PasswordSection from './components/PasswordSection.vue'
9-
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
1010

1111
// eslint-disable-next-line camelcase
12-
__webpack_nonce__ = btoa(OC.requestToken)
12+
__webpack_nonce__ = getCSPNonce()
1313

1414
Vue.prototype.t = t
1515
Vue.prototype.n = n

apps/settings/src/main-personal-webauth.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5-
6-
import Vue from 'vue'
5+
import { getCSPNonce } from '@nextcloud/auth'
76
import { loadState } from '@nextcloud/initial-state'
7+
import Vue from 'vue'
88

99
import WebAuthnSection from './components/WebAuthn/Section.vue'
1010

1111
// eslint-disable-next-line camelcase
12-
__webpack_nonce__ = btoa(OC.requestToken)
12+
__webpack_nonce__ = getCSPNonce()
1313

1414
Vue.prototype.t = t
1515

0 commit comments

Comments
 (0)