summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrun.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/run.py b/run.py
index 6de0c08..926b555 100755
--- a/run.py
+++ b/run.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-from flask import Flask, send_from_directory, render_template, url_for
+from flask import Flask, send_from_directory, render_template, session, abort
from flask_kerberos import init_kerberos, requires_authentication
from classes import Network, Channel, Log
from urllib.parse import quote_plus
@@ -98,5 +98,11 @@ def login(principal):
Logged in! <a href="/">index</a>
'''
+def authenticated():
+ if not session.get('logged_in'):
+ abort(401)
+ else:
+ return True
+
if __name__ == '__main__':
app.run(port=app.config['PORT'])