web/callback.php
changeset 1571 4a1e6952afe5
parent 1558 761ba7426984
equal deleted inserted replaced
1570:c175d505e40d 1571:4a1e6952afe5
    66         'redirect_uri' => URL_ROOT . "callback.php?rep=$rep",
    66         'redirect_uri' => URL_ROOT . "callback.php?rep=$rep",
    67         'grant_type' => 'authorization_code',
    67         'grant_type' => 'authorization_code',
    68         'code' => $_GET['code'],
    68         'code' => $_GET['code'],
    69         'scope' => 'read write push',
    69         'scope' => 'read write push',
    70     ]]);
    70     ]]);
    71     $token_ent = json_decode($token_resp->getBody(), true);
    71     $body = $token_resp->getBody();
       
    72     $token_ent = json_decode($body, true);
    72 
    73 
    73     $_SESSION['SOCIAL_ACCESS_TOKEN'] = serialize($token_ent['access_token']);
    74     $_SESSION['SOCIAL_ACCESS_TOKEN'] = serialize($token_ent['access_token']);
    74     $_SESSION['SOCIAL_AUTH_STATE'] = null;
    75     $_SESSION['SOCIAL_AUTH_STATE'] = null;
    75 
    76 
    76     header('Location: ' . ( URL_ROOT . "$rep/client.php" ) );
    77     header('Location: ' . ( URL_ROOT . "$rep/client.php" ) );