mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-06 06:27:26 +08:00
fix: prevent webapp token used in console
This commit is contained in:
parent
bb9ec1a587
commit
8c78286e5f
@ -37,6 +37,9 @@ def load_user_from_request(request_from_flask_login):
|
||||
raise Unauthorized("Invalid Authorization token.")
|
||||
decoded = PassportService().verify(auth_token)
|
||||
user_id = decoded.get("user_id")
|
||||
source = decoded.get("token_source")
|
||||
if source:
|
||||
raise Unauthorized("Invalid Authorization token.")
|
||||
if not user_id:
|
||||
raise Unauthorized("Invalid Authorization token.")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user