mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
fix: prevent webapp token used in console
This commit is contained in:
@ -37,6 +37,9 @@ def load_user_from_request(request_from_flask_login):
|
|||||||
raise Unauthorized("Invalid Authorization token.")
|
raise Unauthorized("Invalid Authorization token.")
|
||||||
decoded = PassportService().verify(auth_token)
|
decoded = PassportService().verify(auth_token)
|
||||||
user_id = decoded.get("user_id")
|
user_id = decoded.get("user_id")
|
||||||
|
source = decoded.get("token_source")
|
||||||
|
if source:
|
||||||
|
raise Unauthorized("Invalid Authorization token.")
|
||||||
if not user_id:
|
if not user_id:
|
||||||
raise Unauthorized("Invalid Authorization token.")
|
raise Unauthorized("Invalid Authorization token.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user