Skip to content
Snippets Groups Projects
Commit 63e0caca authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Show target-origin as Device in temporary app passwords

parent a46475cc
No related branches found
No related tags found
No related merge requests found
Pipeline #12622 passed
# WebAppPassword Change Log
## 20.8.5
- the `target-origin` will now be shown as `Device` in the temporary app passwords
## 20.8.4
- Update summary and description
......
......@@ -13,7 +13,7 @@ that uses this app to generate a temporary password and make a WebDAV request to
See [Example](https://gitlab.tugraz.at/dbp/nextcloud/webapppassword#example) for a Nextcloud WebDAV file picker example
that uses this application.]]></description>
<version>20.8.4</version>
<version>20.8.5</version>
<licence>agpl</licence>
<author mail="patrizio.bekerle@tugraz.at">Patrizio Bekerle</author>
<namespace>WebAppPassword</namespace>
......
const apiUrl = OC.generateUrl('/apps/webapppassword/create');
console.log("apiUrl", apiUrl);
const url = new URL(window.location.href);
const targetOrigin = decodeURIComponent(url.searchParams.get('target-origin'));
fetch(apiUrl, {
method: 'POST',
headers: {
'target-origin': targetOrigin,
'requesttoken': OC.requestToken
}
})
.then(response => response.json())
.then((data) => {
// console.log("data", data);
const message = {"type": "webapppassword", "loginName": data.loginName, "token": data.token};
const url = new URL(window.location.href);
const targetOrigin = decodeURIComponent(url.searchParams.get('target-origin'));
window.opener.postMessage(message, targetOrigin);
// console.log("targetOrigin", targetOrigin);
// console.log("message", message);
......
......@@ -124,7 +124,8 @@ class PageController extends Controller
}
$loginName = $credentials->getLoginName();
$name = $this->appName.' '.$this->request->getHeader('USER_AGENT');
$targetOrigin = $this->request->getHeader("target-origin");
$name = $targetOrigin . ' ' . $this->request->getHeader('USER_AGENT');
$token = $this->random->generate(
72,
ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment