Mirror of Quill
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.

77 lines
2.4 KiB

7 years ago
  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->destination ?>" 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 know 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 (<code><?= $this->tokenEndpoint ?></code>):</p>
  39. <?php if($this->curl_error): ?>
  40. <div class="bs-callout bs-callout-info pre"><?= $this->curl_error ?></div>
  41. <?php endif ?>
  42. <?php if($this->response): ?>
  43. <div class="bs-callout bs-callout-info pre"><?= htmlspecialchars($this->response) ?></div>
  44. <?php endif ?>
  45. <?php else: ?>
  46. <h3>Error</h3>
  47. <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>
  48. <?php endif; ?>
  49. </div>