mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-09 07:01:49 +08:00
fix: add logging
This commit is contained in:
parent
9462ed7bbf
commit
d1a25e54e5
@ -1,3 +1,4 @@
|
||||
import logging
|
||||
from functools import wraps
|
||||
|
||||
from flask_login import current_user # type: ignore
|
||||
@ -59,10 +60,12 @@ def user_allowed_to_access_app(view=None):
|
||||
if feature.webapp_auth.enabled:
|
||||
app_id = kwargs.get("installed_app_id")
|
||||
app_code = AppService.get_app_code_by_id(app_id)
|
||||
logging.info(f"app_id: {app_id}, app_code: {app_code}")
|
||||
res = EnterpriseService.WebAppAuth.is_user_allowed_to_access_webapp(
|
||||
user_id=str(current_user.id),
|
||||
app_code=app_code,
|
||||
)
|
||||
logging.info(f"res: {res}")
|
||||
if not res:
|
||||
raise Unauthorized("User not allowed to access this app")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user