diff --git a/packages/file-handling/src/vpu-nextcloud-file-picker.js b/packages/file-handling/src/vpu-nextcloud-file-picker.js
index 02d68f534fec6758912fb8bcda3fbfee694ebe90..b83c5c424850a71c179d6258130c0c447c614d9b 100644
--- a/packages/file-handling/src/vpu-nextcloud-file-picker.js
+++ b/packages/file-handling/src/vpu-nextcloud-file-picker.js
@@ -155,7 +155,8 @@ export class NextcloudFilePicker extends ScopedElementsMixin(VPULitElement) {
     openFilePicker() {
         // TODO: translation
         this.statusText = "Auth in progress";
-        this.loginWindow = window.open(this.authUrl, "Nextcloud Login",
+        const authUrl = this.authUrl + "?target-origin=" + encodeURIComponent(window.location.href);
+        this.loginWindow = window.open(authUrl, "Nextcloud Login",
             "width=400,height=400,menubar=no,scrollbars=no,status=no,titlebar=no,toolbar=no");
     }