fix(next-cloud-node): Fix issue with credential verification and sharing file

This commit is contained in:
Michael Kret
2022-08-19 16:35:01 +03:00
committed by GitHub
parent 11617616cd
commit 2b4f5c6c78
2 changed files with 8 additions and 4 deletions

View File

@@ -21,8 +21,7 @@ export async function nextCloudApiRequest(
headers?: object,
encoding?: null | undefined,
query?: object,
// tslint:disable-next-line:no-any
): Promise<any> {
) {
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
const authenticationMethod = this.getNodeParameter('authentication', 0);
@@ -49,10 +48,15 @@ export async function nextCloudApiRequest(
}
options.uri = `${credentials.webDavUrl}/${encodeURI(endpoint)}`;
if (resource === 'user' && operation === 'create') {
options.uri = options.uri.replace('/remote.php/webdav', '');
}
if (resource === 'file' && operation === 'share') {
options.uri = options.uri.replace('/remote.php/webdav', '');
}
const credentialType =
authenticationMethod === 'accessToken' ? 'nextCloudApi' : 'nextCloudOAuth2Api';