diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/auth_callback.php | 16 | ||||
-rw-r--r-- | views/auth_start.php | 52 |
2 files changed, 32 insertions, 36 deletions
diff --git a/views/auth_callback.php b/views/auth_callback.php index acdac8f..4d6ad5e 100644 --- a/views/auth_callback.php +++ b/views/auth_callback.php @@ -54,11 +54,15 @@ <h3>Token endpoint response</h3> - <p>Below is the raw response from your token endpoint (<?= $this->tokenEndpoint ?>):</p> - <div class="bs-callout bs-callout-info pre"> - <?= $this->curl_error ?> - <?= htmlspecialchars($this->response) ?> - </div> + <p>Below is the raw response from your token endpoint (<code><?= $this->tokenEndpoint ?></code>):</p> + + <?php if($this->curl_error): ?> + <div class="bs-callout bs-callout-info pre"><?= $this->curl_error ?></div> + <?php endif ?> + + <?php if($this->response): ?> + <div class="bs-callout bs-callout-info pre"><?= htmlspecialchars($this->response) ?></div> + <?php endif ?> <?php else: ?> @@ -70,4 +74,4 @@ <?php endif; ?> -</div>
\ No newline at end of file +</div> diff --git a/views/auth_start.php b/views/auth_start.php index d41ffb4..a6df0da 100644 --- a/views/auth_start.php +++ b/views/auth_start.php @@ -1,62 +1,54 @@ <div class="narrow"> <?= partial('partials/header') ?> -<div id="authorization_endpoint"> - <h3>Authorization Endpoint</h3> - <p><i>The authorization endpoint tells this app where to direct your browser to sign you in.</i></p> +<?php if(!$this->authorizationEndpoint): ?> + <div id="authorization_endpoint"> + <h3>Authorization Endpoint</h3> + + <p><i>The authorization endpoint tells this app where to direct your browser to sign you in.</i></p> - <?php if($this->authorizationEndpoint): ?> - <div class="bs-callout bs-callout-success">Found your authorization endpoint: <code><?= $this->authorizationEndpoint ?></code></div> - <?php else: ?> <div class="bs-callout bs-callout-danger">Could not find your authorization endpoint!</div> <p>You need to set your authorization endpoint in a <code><link></code> tag on your home page.</p> <?= partial('partials/auth-endpoint-help') ?> - <?php endif; ?> -</div> + </div> +<?php endif; ?> -<div id="token_endpoint"> - <h3>Token Endpoint</h3> +<?php if(!$this->tokenEndpoint): ?> + <div id="token_endpoint"> + <h3>Token Endpoint</h3> - <p><i>The token endpoint is where this app will make a request to get an access token after obtaining authorization.</i></p> + <p><i>The token endpoint is where this app will make a request to get an access token after obtaining authorization.</i></p> - <?php if($this->tokenEndpoint): ?> - <div class="bs-callout bs-callout-success">Found your token endpoint: <code><?= $this->tokenEndpoint ?></code></div> - <?php else: ?> <div class="bs-callout bs-callout-danger">Could not find your token endpoint!</div> <p>You need to set your token endpoint in a <code><link></code> tag on your home page.</p> <?= partial('partials/token-endpoint-help') ?> - <?php endif; ?> - -</div> + </div> +<?php endif; ?> -<div id="micropub_endpoint"> - <h3>Micropub Endpoint</h3> +<?php if(!$this->micropubEndpoint): ?> + <div id="micropub_endpoint"> + <h3>Micropub Endpoint</h3> - <p><i>The Micropub endpoint is the URL this app will use to post new photos.</i></p> + <p><i>The Micropub endpoint is the URL this app will use to post new photos.</i></p> - <?php if($this->micropubEndpoint): ?> - <div class="bs-callout bs-callout-success"> - Found your Micropub endpoint: <code><?= $this->micropubEndpoint ?></code> - </div> - <?php else: ?> <div class="bs-callout bs-callout-danger">Could not find your Micropub endpoint!</div> <p>You need to set your Micropub endpoint in a <code><link></code> tag on your home page.</p> <?= partial('partials/micropub-endpoint-help', $this) ?> - <?php endif; ?> + </div> +<?php endif; ?> -</div> <?php if($this->authorizationURL): ?> - <h3>Ready!</h3> + <h3>Sign In</h3> - <p>Clicking the button below will take you to <strong>your</strong> authorization server which is where you will allow this app to be able to post to your site.</p> + <p>Click the button below to go to your website to allow this app to be able to post to your site.</p> <form action="/auth/redirect" method="get"> <p>Choose the scope to request:</p> <ul style="list-style-type: none;"> - <li><input type="radio" name="scope" value="create update" checked="checked"> create update</li> + <li><input type="radio" name="scope" value="create update media" checked="checked"> create update media (default)</li> <li><input type="radio" name="scope" value="create"> create</li> <li><input type="radio" name="scope" value="post"> post (legacy)</li> </ul> |