Playready CDMs
{prList.length === 0 ? (
diff --git a/configs/index_tags.py b/configs/index_tags.py
index 2b4a6dd..aed1510 100644
--- a/configs/index_tags.py
+++ b/configs/index_tags.py
@@ -34,5 +34,14 @@ tags = {
'opengraph_image': 'https://cdrm-project.com/og-api.jpg',
'opengraph_url': 'https://cdrm-project.com/api',
'tab_title': 'API',
+ },
+ 'account': {
+ 'description': 'Account for CDRM-Project',
+ 'keywords': 'Login, CDRM, CDM, CDRM-Project, register, account',
+ 'opengraph_title': 'My account',
+ 'opengraph_description': 'Account for CDRM-Project',
+ 'opengraph_image': 'https://cdrm-project.com/og-home.jpg',
+ 'opengraph_url': 'https://cdrm-project.com/account',
+ 'tab_title': 'My account',
}
}
\ No newline at end of file
diff --git a/custom_functions/prechecks/config_file_checks.py b/custom_functions/prechecks/config_file_checks.py
index 9c9c320..5ca2e58 100644
--- a/custom_functions/prechecks/config_file_checks.py
+++ b/custom_functions/prechecks/config_file_checks.py
@@ -7,6 +7,7 @@ def check_for_config_file():
default_config = """\
default_wv_cdm: ''
default_pr_cdm: ''
+secret_key_flask: 'secretkey'
# change the type to mariadb to use mariadb below
database_type: 'sqlite'
fqdn: ''
diff --git a/main.py b/main.py
index 8ac46c6..0edade8 100644
--- a/main.py
+++ b/main.py
@@ -12,9 +12,12 @@ from routes.upload import upload_bp
from routes.user_info import user_info_bp
from routes.register import register_bp
from routes.login import login_bp
-
+import os
+import yaml
app = Flask(__name__)
-app.secret_key = 'TT'
+with open(f'{os.getcwd()}/configs/config.yaml', 'r') as file:
+ config = yaml.safe_load(file)
+app.secret_key = config['secret_key_flask']
CORS(app)
diff --git a/routes/login.py b/routes/login.py
index c20ba93..167015d 100644
--- a/routes/login.py
+++ b/routes/login.py
@@ -30,3 +30,8 @@ def login_status():
return jsonify({'message': 'False'})
except:
return jsonify({'message': 'False'})
+
+@login_bp.route('/logout', methods=['POST'])
+def logout():
+ session.pop('username', None)
+ return jsonify({'message': 'Successfully logged out!'})
\ No newline at end of file
diff --git a/routes/react.py b/routes/react.py
index 5ca327a..6da08f6 100644
--- a/routes/react.py
+++ b/routes/react.py
@@ -26,7 +26,7 @@ def index(path=''):
file_path = os.path.join(react_bp.static_folder, path)
if path != "" and os.path.exists(file_path):
return send_from_directory(react_bp.static_folder, path)
- elif path.lower() in ['', 'cache', 'api', 'testplayer']:
+ elif path.lower() in ['', 'cache', 'api', 'testplayer', 'account']:
data = index_tags.tags.get(path.lower(), index_tags.tags['index'])
return render_template('index.html', data=data)
else: