password is checked via hash now
This commit is contained in:
parent
ab27d70946
commit
2702ce3c3c
@ -15,9 +15,9 @@ from sqlalchemy.orm import DeclarativeBase
|
|||||||
import os
|
import os
|
||||||
import csv
|
import csv
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
import hashlib
|
||||||
|
|
||||||
random_order = True
|
# activate environment: cd C:\...\...\....\...\Code\SLAEForms Testing\.venv\Scripts\
|
||||||
# activate environment: cd C:\Users\Jan\Google Drive\Master Stuff\Code\SLAEForms Testing\.venv\Scripts\
|
|
||||||
# then this: activate
|
# then this: activate
|
||||||
|
|
||||||
#SETUP--------------------------------------------------
|
#SETUP--------------------------------------------------
|
||||||
@ -41,7 +41,7 @@ app.secret_key = b"29fe9e8edd407c5491d4f1c05632d9fa33e26ed8734a3f5e080ebac3772a5
|
|||||||
|
|
||||||
UPLOAD_FOLDER = 'uploads'
|
UPLOAD_FOLDER = 'uploads'
|
||||||
EXPORT_FOLDER = 'exports'
|
EXPORT_FOLDER = 'exports'
|
||||||
PASSWORD = '#1ACGmsjd'
|
PASSWORD = 'd5aff9fc14d1f20f4ccddaa8b4f2c1765228b74ed0b1dfb868bf1064e0d655e2'
|
||||||
CONFIGFILE = 'userstudy1.json'
|
CONFIGFILE = 'userstudy1.json'
|
||||||
# CONFIGFILE = 'test.json'
|
# CONFIGFILE = 'test.json'
|
||||||
# CONFIGFILE = 'default.json'
|
# CONFIGFILE = 'default.json'
|
||||||
@ -622,7 +622,8 @@ def show_tables():
|
|||||||
def login():
|
def login():
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
if request.form["password"] == PASSWORD:
|
pwhash = hashlib.sha256(request.form["password"].encode('utf-8')).hexdigest()
|
||||||
|
if pwhash == PASSWORD:
|
||||||
session["logged_in"] = True
|
session["logged_in"] = True
|
||||||
return redirect(url_for("all_links"))
|
return redirect(url_for("all_links"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user