fix: old webapp url still valid (#1643)

This commit is contained in:
crazywoola
2023-11-28 20:04:46 +08:00
committed by GitHub
parent c21e2063fe
commit cf0ba794d7
2 changed files with 17 additions and 22 deletions

View File

@@ -40,7 +40,7 @@ def decode_jwt_token():
site = db.session.query(Site).filter(Site.code == app_code).first()
if not app_model:
raise NotFound()
if not app_code and not site:
if not app_code or not site:
raise Unauthorized('Site URL is no longer valid.')
if app_model.enable_site is False:
raise Unauthorized('Site is disabled.')