miroir de
https://github.com/nextcloud/server.git
synchronisé 2024-08-23 17:57:31 +02:00
fix(files_external): basic auth user storage trigger
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Cette révision appartient à :
Parent
e6d0105217
révision
ae29608e46
@ -126,6 +126,7 @@ class ApiController extends OCSController {
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Ask for credentials using a browser's native basic auth prompt
|
||||
* Then returns it if provided
|
||||
|
@ -75,11 +75,13 @@ export const action = new FileAction({
|
||||
|
||||
async exec(node: Node) {
|
||||
// always resolve auth request, we'll process the data afterwards
|
||||
const response = await axios.get(generateOcsUrl('/apps/files_external/api/v1/auth'), {
|
||||
validateStatus: () => true,
|
||||
// Using fetch as axios have integrated auth handling and X-Requested-With header
|
||||
const response = await fetch(generateOcsUrl('/apps/files_external/api/v1/auth'), {
|
||||
headers: new Headers({ Accept: 'application/json' }),
|
||||
credentials: 'include',
|
||||
})
|
||||
|
||||
const data = (response?.data || {}) as OCSAuthResponse
|
||||
const data = (await response?.json() || {}) as OCSAuthResponse
|
||||
if (data.ocs.data.user && data.ocs.data.password) {
|
||||
const configResponse = await axios.put(generateUrl('apps/files_external/userglobalstorages/{id}', node.attributes), {
|
||||
backendOptions: data.ocs.data,
|
||||
|
4
dist/files_external-init.js
externe
4
dist/files_external-init.js
externe
Diff de fichier supprimé car une ou plusieurs lignes sont trop longues
2
dist/files_external-init.js.map
externe
2
dist/files_external-init.js.map
externe
Diff de fichier supprimé car une ou plusieurs lignes sont trop longues
Chargement…
Référencer dans un nouveau ticket
Block a user