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.

73 lines
2.3KB

  1. <div class="narrow">
  2. <?= partial('partials/header') ?>
  3. <?php if($this->tokenEndpoint): ?>
  4. <?php if(!$this->auth): ?>
  5. <h3>Bad response from token endpoint</h3>
  6. <p>Your token endpoint returned a response that was not understood.</p>
  7. <?php else: ?>
  8. <?php if(k($this->auth, 'error')): ?>
  9. <h3>Error</h3>
  10. <p>Got an error response from the token endpoint:</p>
  11. <div class="bs-callout bs-callout-danger">
  12. <h4><?= $this->auth['error'] ?></h4>
  13. <?= k($this->auth, 'error_description') ? ('<p>'.$this->auth['error_description'].'</p>') : '' ?>
  14. </div>
  15. <?php else: ?>
  16. <!-- Check for all the required parts of the token -->
  17. <?php if(k($this->auth, array('me','access_token','scope'))): ?>
  18. <h3>Success!</h3>
  19. <p>All required values were found! You are now signed in.</p>
  20. <p><a href="<?= $this->redirect ?>" class="btn btn-primary">Continue</a></p>
  21. <?php else: ?>
  22. <?php if(!k($this->auth, 'access_token')): ?>
  23. <h4>Missing <code>access_token</code></h4>
  24. <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>
  25. <?php endif; ?>
  26. <?php if(!k($this->auth, 'me')): ?>
  27. <h4>Missing <code>me</code></h4>
  28. <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>
  29. <?php endif; ?>
  30. <?php if(!k($this->auth, 'scope')): ?>
  31. <h4>Missing <code>scope</code></h4>
  32. <p>The token endpoint did not return a "scope" parameter. The <code>scope</code> parameter lets this client what permission the token represents.</p>
  33. <?php endif; ?>
  34. <?php endif; ?>
  35. <?php endif; ?>
  36. <?php endif; ?>
  37. <h3>Token endpoint response</h3>
  38. <p>Below is the raw response from your token endpoint (<?= $this->tokenEndpoint ?>):</p>
  39. <div class="bs-callout bs-callout-info pre">
  40. <?= $this->curl_error ?>
  41. <?= htmlspecialchars($this->response) ?>
  42. </div>
  43. <?php else: ?>
  44. <h3>Error</h3>
  45. <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>
  46. <?php endif; ?>
  47. </div>