You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.2 KiB

  1. <?php if($this->tokenEndpoint): ?>
  2. <?php if(!$this->auth): ?>
  3. <h3>Bad response from token endpoint</h3>
  4. <p>Your token endpoint returned a response that was not understood.</p>
  5. <?php else: ?>
  6. <?php if(k($this->auth, 'error')): ?>
  7. <h3>Error</h3>
  8. <p>Got an error response from the token endpoint:</p>
  9. <div class="bs-callout bs-callout-danger">
  10. <h4><?= $this->auth['error'] ?></h4>
  11. <?= k($this->auth, 'error_description') ? ('<p>'.$this->auth['error_description'].'</p>') : '' ?>
  12. </div>
  13. <?php else: ?>
  14. <!-- Check for all the required parts of the token -->
  15. <?php if(k($this->auth, array('me','access_token','scope'))): ?>
  16. <h3>Success!</h3>
  17. <p>All required values were found! You are now signed in.</p>
  18. <p><a href="/new" class="btn btn-primary">Continue</a></p>
  19. <?php else: ?>
  20. <?php if(!k($this->auth, 'access_token')): ?>
  21. <h4>Missing <code>access_token</code></h4>
  22. <p>The token endpoint did not return an access token. The <code>access_token</code> parameter is the token the client will use to make requests to the Micropub endpoint.</p>
  23. <?php endif; ?>
  24. <?php if(!k($this->auth, 'me')): ?>
  25. <h4>Missing <code>me</code></h4>
  26. <p>The token endpoint did not return a "me" parameter. The <code>me</code> parameter lets this client know what user the token is for.</p>
  27. <?php endif; ?>
  28. <?php if(!k($this->auth, 'scope')): ?>
  29. <h4>Missing <code>scope</code></h4>
  30. <p>The token endpoint did not return a "scope" parameter. The <code>scope</code> parameter lets this client what permission the token represents.</p>
  31. <?php endif; ?>
  32. <?php endif; ?>
  33. <?php endif; ?>
  34. <?php endif; ?>
  35. <h3>Token endpoint response</h3>
  36. <p>Below is the raw response from your token endpoint (<?= $this->tokenEndpoint ?>):</p>
  37. <div class="bs-callout bs-callout-info pre">
  38. <?= $this->curl_error ?>
  39. <?= htmlspecialchars($this->response) ?>
  40. </div>
  41. <?php else: ?>
  42. <h3>Error</h3>
  43. <p>Could not find your token endpoint. We found it last time, so double check nothing on your website has changed in the mean time.</p>
  44. <?php endif; ?>