aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2022-02-15 15:12:32 -0500
committerB Stack <bgstack15@gmail.com>2022-02-15 15:12:32 -0500
commit0556ebe21c3143be2a3e32c4f49e127044bdd47c (patch)
tree6c7074e9b02b3aac380e74569da2d041f24700cb /templates
parentshore up docs (diff)
downloadstackbin-0556ebe21c3143be2a3e32c4f49e127044bdd47c.tar.gz
stackbin-0556ebe21c3143be2a3e32c4f49e127044bdd47c.tar.bz2
stackbin-0556ebe21c3143be2a3e32c4f49e127044bdd47c.zip
pw-protect /admin endpoint
Use a hardcoded password from the config file.
Diffstat (limited to 'templates')
-rw-r--r--templates/layout.html2
-rw-r--r--templates/login_form.html16
2 files changed, 18 insertions, 0 deletions
diff --git a/templates/layout.html b/templates/layout.html
index 3c6d8ab..3620a3a 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -9,6 +9,8 @@
<div class=page>
<ul class=nav>
<li><a href="{{ url_for('new_paste') }}">New Paste</a>
+ {% if g.user and g.user == "admin" %}<li><a href="{{ url_for('admin') }}">admin</a></li>{% endif %}
+ {% if g.user %}<li><a href="{{ url_for('logout') }}">Sign out</a></li>{% endif %}
{#
{% if g.user %}
<li><a href="{{ url_for('my_pastes') }}">My Pastes</a>
diff --git a/templates/login_form.html b/templates/login_form.html
new file mode 100644
index 0000000..b179732
--- /dev/null
+++ b/templates/login_form.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+<title>Login Form</title>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<center>
+<h1>Login Form</h1>
+<form action="{{ login_url }}" method="post">
+<p>Username <input type="text" value="" name="username" required/></p>
+<p>Password <input type="password" name="password" required/></p>
+<p><input accesskey="s" type="submit" value="Submit"/></p>
+</form>
+</center>
+</body>
+</html>
bgstack15