File tree 3 files changed +17
-3
lines changed
src/components/NcRichText
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 75
75
"@nextcloud/l10n" : " ^3.0.1" ,
76
76
"@nextcloud/logger" : " ^3.0.1" ,
77
77
"@nextcloud/router" : " ^3.0.0" ,
78
+ "@nextcloud/sharing" : " ^0.2.2" ,
78
79
"@nextcloud/timezones" : " ^0.1.1" ,
79
80
"@nextcloud/vue-select" : " ^3.25.0" ,
80
81
"@vueuse/components" : " ^10.9.0" ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import NcReferenceWidget from './NcReferenceWidget.vue'
15
15
import { URL_PATTERN } from './helpers.js'
16
16
17
17
import axios from '@nextcloud/axios'
18
+ import { getSharingToken } from '@nextcloud/sharing/public'
18
19
import { getCurrentUser } from '@nextcloud/auth'
19
20
import { generateOcsUrl } from '@nextcloud/router'
20
21
@@ -120,10 +121,9 @@ export default {
120
121
resolve() {
121
122
const match = (new RegExp(URL_PATTERN).exec(this.text.trim()))
122
123
const isPublic = getCurrentUser() === null
123
- const sharingToken = document.getElementById('sharingToken')?.value || ''
124
124
if (this.limit === 1 && match) {
125
125
return isPublic
126
- ? axios.get(generateOcsUrl('references/resolvePublic') + `?reference=${encodeURIComponent(match[0])}&sharingToken=${sharingToken }`)
126
+ ? axios.get(generateOcsUrl('references/resolvePublic') + `?reference=${encodeURIComponent(match[0])}&sharingToken=${getSharingToken() }`)
127
127
: axios.get(generateOcsUrl('references/resolve') + `?reference=${encodeURIComponent(match[0])}`)
128
128
}
129
129
@@ -132,7 +132,7 @@ export default {
132
132
text: this.text,
133
133
resolve: true,
134
134
limit: this.limit,
135
- sharingToken,
135
+ sharingToken: getSharingToken() ,
136
136
})
137
137
: axios.post(generateOcsUrl('references/extract'), {
138
138
text: this.text,
You can’t perform that action at this time.
0 commit comments