1
0
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 à :
John Molakvoæ 2023-10-05 11:23:55 +02:00
Parent e6d0105217
révision ae29608e46
Signature inconnue de Gitea
ID de la clé GPG: 60C25B8C072916CF
4 fichiers modifiés avec 9 ajouts et 6 suppressions

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

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,

Diff de fichier supprimé car une ou plusieurs lignes sont trop longues

Diff de fichier supprimé car une ou plusieurs lignes sont trop longues