diff --git a/acks/__init__.py b/acks/__init__.py
index cc74e81..ecda32b 100644
--- a/acks/__init__.py
+++ b/acks/__init__.py
@@ -14,8 +14,9 @@ def create_app():
db.init_app(app)
# Prep basic auth
- from acks.views import basic_auth
+ from acks.views import basic_auth, player_auth
basic_auth.init_app(app)
+ player_auth.init_app(app)
# Load our views
from acks.views import default_views
diff --git a/acks/templates/worldmap.html b/acks/templates/worldmap.html
index 81ca605..d7cae23 100644
--- a/acks/templates/worldmap.html
+++ b/acks/templates/worldmap.html
@@ -13,10 +13,10 @@
Continent Overview
Continent Full
-
-
- 1 hex = 96 miles
- 1 hex = 24 miles
+
{% endblock %}
@@ -29,4 +29,16 @@ h1 strong {
opacity: 0.65;
}
+
+{% endblock %}
+
+{% block scripts %}
+
+
+
+
+
+
{% endblock %}
diff --git a/acks/views.py b/acks/views.py
index 44e0f05..a1198a7 100644
--- a/acks/views.py
+++ b/acks/views.py
@@ -5,7 +5,16 @@ from flask_basicauth import BasicAuth
+class PlayerAuth(BasicAuth):
+ def init_app(self, app):
+ super().init_app(app)
+ self.player_password = app.config['PLAYER_BASIC_AUTH_PASSWORD']
+
+ def check_credentials(self, username, password):
+ return (password == self.player_password)
+
basic_auth = BasicAuth()
+player_auth = PlayerAuth()
default_views = Blueprint('default_views', __name__, url_prefix='/')
@default_views.route('/')
@@ -43,6 +52,7 @@ def lair_gallery():
return render_template('lair_gallery.html', animal=animal_lairs, humanoid=humanoid_lairs)
@default_views.route('/player_tokens')
+@player_auth.required
def token_gallery():
base_path = "/srv/www/atr0phy.net/acks/img/player_tokens/"
base_url = "https://www.atr0phy.net/acks/img/player_tokens/"