Parcourir la source

fix(files_external): basic auth user storage trigger

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
tags/v28.0.0beta1
John Molakvoæ il y a 9 mois
Parent
révision
ae29608e46
Aucun compte lié à l'adresse e-mail de l'auteur

+ 1
- 0
apps/files_external/lib/Controller/ApiController.php Voir le fichier

@@ -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

+ 5
- 3
apps/files_external/src/actions/enterCredentialsAction.ts Voir le fichier

@@ -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,

+ 2
- 2
dist/files_external-init.js
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 1
- 1
dist/files_external-init.js.map
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


Chargement…
Annuler
Enregistrer