File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 54
54
from monkey_island .cc .setup .mongo .mongo_setup import MONGO_DB_HOST , MONGO_DB_NAME , MONGO_DB_PORT
55
55
56
56
HOME_FILE = "index.html"
57
+ AUTH_EXPIRATION_TIME = 30 * 60 # 30 minutes authentication token expiration time
57
58
58
59
59
60
def serve_static_file (static_path ):
@@ -94,7 +95,10 @@ def setup_authentication(app, data_dir):
94
95
app .config ["SECURITY_USERNAME_REQUIRED" ] = True
95
96
app .config ["SECURITY_REGISTERABLE" ] = True
96
97
app .config ["SECURITY_SEND_REGISTER_EMAIL" ] = False
98
+
99
+ app .config ["SECURITY_TOKEN_MAX_AGE" ] = AUTH_EXPIRATION_TIME
97
100
# Ignore CSRF, because it's irrelevant for javascript applications
101
+ app .config ["WTF_CSRF_ENABLED" ] = False
98
102
app .config ["WTF_CSRF_CHECK_DEFAULT" ] = False
99
103
app .config ["SECURITY_CSRF_IGNORE_UNAUTH_ENDPOINTS" ] = True
100
104
# Forbid sending authentication token in URL parameters
You can’t perform that action at this time.
0 commit comments