1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 20:37:42 +00:00

Update internal_api.py (#6661)

* Update internal_api.py

* update

* Update utils.py

* Update utils.py

* update

* Update utils.py

* Update settings.py
This commit is contained in:
Ranjiwei
2024-08-29 16:09:39 +08:00
committed by GitHub
parent b47227134f
commit 1bb214f6c7
2 changed files with 8 additions and 2 deletions

View File

@@ -33,7 +33,9 @@ from seahub.avatar.templatetags.avatar_tags import api_avatar_url
from seahub.utils import get_user_repos
from seahub.utils.mail import send_html_email_with_dj_template
from django.utils.translation import gettext as _
from seahub.settings import SECRET_KEY
import seahub.settings as settings
JWT_PRIVATE_KEY = getattr(settings, 'JWT_PRIVATE_KEY', '')
logger = logging.getLogger(__name__)
@@ -331,7 +333,7 @@ def is_valid_internal_jwt(auth):
return False
try:
payload = jwt.decode(token, SECRET_KEY, algorithms=['HS256'])
payload = jwt.decode(token, JWT_PRIVATE_KEY, algorithms=['HS256'])
except:
return False
else:

View File

@@ -122,6 +122,8 @@ STATICFILES_FINDERS = (
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'n*v0=jz-1rz@(4gx^tf%6^e7c&um@2)g-l=3_)t@19a69n1nv6'
JWT_PRIVATE_KEY = ''
ENABLE_REMOTE_USER_AUTHENTICATION = False
# Order is important
@@ -970,6 +972,8 @@ else:
load_local_settings(seahub_settings)
del seahub_settings
JWT_PRIVATE_KEY = os.environ.get('JWT_PRIVATE_KEY', '') or JWT_PRIVATE_KEY
# Remove install_topdir from path
sys.path.pop(0)