{% extends "_root.html" %}
{% block body %}
<h1>Post Redemption</h1>
{% if error %}
<article class="status-error">
	<header class="status-error-header">Error</header>
	<div class="status-box-content">
		<p>{{ error }}</p>
		{% if resp %}
		<p>
			Your server responded with a <code>{{ resp.error }}</code> kind of error.
			{% if resp.error_description %}It stated that: {{ resp.error_description }}{% endif %}
		</p>
		{% endif %}
	</div>
</article>
{% else %}
{% if profile %}
<p>Your server returned a profile response!.</p>
<ul>
	<li>Name: {{ profile.profile.name }}</li>
	{% if profile.profile.email %}<li>Email: {{ profile.profile.email }}</li>{% endif %}
	{% if profile.profile.photo %}<li>Photo: {{ profile.profile.photo }}</li>{% endif %}
	{% if profile.profile.url %}<li>URL: {{ profile.profile.url }}</li>{% endif %}
</ul>
{% endif %}
<p>Your server returned a token.</p>
<ul>
	<li>Secret: <code>{{ token }}</code></li>
	{% if refresh_token %}<li>Refresh secret: <code>{{ refresh_token }}</code></li>{% endif %}
	<li>Scopes: {{ scope }}</li>
	<li>Expires in {{ expires_in }} seconds </li>
	<li>User profile is <a href="{{ me }}">{{ me }}</a></li>
</ul>
{% endif %}
<p>
	You can try again at <a href="/client">the client</a>.
</p>
{% endblock body %}
