aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Magic.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-01 22:34:31 -0700
committerzotlabs <mike@macgirvin.com>2017-11-01 22:34:31 -0700
commitf23c8e7597b6d96639738d0180e8cb277682ce23 (patch)
treeffcb15dd536800b67c9918756e41bb4accde3320 /Zotlabs/Module/Magic.php
parente539a9e7bdd035f96d8e8406e3433d34d99435da (diff)
parent11cdc36bcc7414002c2e72fd0c45d285d9515f0c (diff)
downloadvolse-hubzilla-f23c8e7597b6d96639738d0180e8cb277682ce23.tar.gz
volse-hubzilla-f23c8e7597b6d96639738d0180e8cb277682ce23.tar.bz2
volse-hubzilla-f23c8e7597b6d96639738d0180e8cb277682ce23.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Module/Magic.php')
-rw-r--r--Zotlabs/Module/Magic.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php
index 879085f96..9ad9c951c 100644
--- a/Zotlabs/Module/Magic.php
+++ b/Zotlabs/Module/Magic.php
@@ -146,10 +146,17 @@ class Magic extends \Zotlabs\Web\Controller {
if($x['success']) {
$j = json_decode($x['body'],true);
- if($j['success'] && $j['token']) {
- $x = strpbrk($dest,'?&');
- $args = (($x) ? '&owt=' . $j['token'] : '?f=&owt=' . $j['token']) . (($delegate) ? '&delegate=1' : '');
+ if($j['success']) {
+ $token = '';
+ if($j['encrypted_token']) {
+ openssl_private_decrypt(base64url_decode($j['encrypted_token']),$token,$channel['channel_prvkey']);
+ }
+ else {
+ $token = $j['token'];
+ }
+ $x = strpbrk($dest,'?&');
+ $args = (($x) ? '&owt=' . $token : '?f=&owt=' . $token) . (($delegate) ? '&delegate=1' : '');
goaway($dest . $args);
}
}