/**
  * @NoAdminRequired
  * @NoCSRFRequired
  * @PublicPage
  */
 public function getTokenWithTemporaryPassword()
 {
     $tp = isset($_POST['tp']) ? $_POST['tp'] : null;
     $_response = array('success' => false);
     if ($tp !== null) {
         try {
             $token = Security::getSignedComboFromTemporaryPassword($tp);
             $_response = array_merge($_response, $token);
             $_response['success'] = true;
         } catch (\Exception $e) {
             $_response['error'] = $e->getCode();
         }
     }
     return new DataResponse($_response);
 }
 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  * @PublicPage
  */
 public function getTokenWithTemporaryPassword($tp)
 {
     $tmp = base64_decode($tp, true);
     // We support both base64 encoded and unencoded TPs
     if ($tmp !== false) {
         $tp = $tmp;
     }
     $_response = array('success' => false);
     if ($tp) {
         try {
             $token = Security::getSignedComboFromTemporaryPassword($tp);
             $_response = array_merge($_response, $token);
             $_response['success'] = true;
         } catch (\Exception $e) {
             $_response['error'] = $e->getCode();
         }
     }
     return new DataResponse($_response);
 }