| 1 |
{% extends "base.html" %} |
| 2 |
|
| 3 |
{% block title %}Authorize - Makenotwork{% endblock %} |
| 4 |
|
| 5 |
{% block body_attrs %} class="centered-page"{% endblock %} |
| 6 |
|
| 7 |
{% block content %} |
| 8 |
<h1 class="brand-h1">Makenot<span class="dot">.</span>work</h1> |
| 9 |
<div class="login-container"> |
| 10 |
|
| 11 |
{% if let Some(msg) = error_message %} |
| 12 |
<div class="alert alert-error">{{ msg }}</div> |
| 13 |
{% endif %} |
| 14 |
|
| 15 |
<form class="login-form" method="POST" action="/oauth/authorize"> |
| 16 |
<h2 class="subtitle-h2"> |
| 17 |
{% if session_user.is_some() %} |
| 18 |
Authorize {{ app_name }} |
| 19 |
{% else %} |
| 20 |
Log in to authorize {{ app_name }} |
| 21 |
{% endif %} |
| 22 |
</h2> |
| 23 |
|
| 24 |
{% if let Some(user) = session_user %} |
| 25 |
<p>Logged in as <strong>{{ user.username }}</strong></p> |
| 26 |
{% else %} |
| 27 |
<div class="form-group"> |
| 28 |
<label for="login">Username or Email</label> |
| 29 |
<input |
| 30 |
type="text" |
| 31 |
id="login" |
| 32 |
name="login" |
| 33 |
placeholder="username or you@example.com" |
| 34 |
required |
| 35 |
autofocus |
| 36 |
/> |
| 37 |
</div> |
| 38 |
|
| 39 |
<div class="form-group"> |
| 40 |
<label for="password">Password</label> |
| 41 |
<input |
| 42 |
type="password" |
| 43 |
id="password" |
| 44 |
name="password" |
| 45 |
placeholder="--------" |
| 46 |
required |
| 47 |
/> |
| 48 |
</div> |
| 49 |
{% endif %} |
| 50 |
|
| 51 |
<input type="hidden" name="client_id" value="{{ client_id }}" /> |
| 52 |
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}" /> |
| 53 |
<input type="hidden" name="state" value="{{ state }}" /> |
| 54 |
<input type="hidden" name="code_challenge" value="{{ code_challenge }}" /> |
| 55 |
<input type="hidden" name="code_challenge_method" value="{{ code_challenge_method }}" /> |
| 56 |
{% if let Some(token) = csrf_token %} |
| 57 |
<input type="hidden" name="_csrf" value="{{ token }}" /> |
| 58 |
{% endif %} |
| 59 |
|
| 60 |
<button type="submit" class="btn-primary"> |
| 61 |
{% if session_user.is_some() %} |
| 62 |
Authorize |
| 63 |
{% else %} |
| 64 |
Log In & Authorize |
| 65 |
{% endif %} |
| 66 |
</button> |
| 67 |
|
| 68 |
<div class="foot-link"> |
| 69 |
Don't have an account? <a href="/join">Join at makenot.work<span class="dot">.</span></a> |
| 70 |
</div> |
| 71 |
</form> |
| 72 |
</div> |
| 73 |
{% endblock %} |
| 74 |
|