From fd815d390dfa22c7d8fd6ed1eb45e57d496d75db Mon Sep 17 00:00:00 2001 From: GareArc Date: Thu, 5 Jun 2025 01:47:04 +0900 Subject: [PATCH] fix: remove granted_at from login token --- api/controllers/web/passport.py | 2 ++ api/services/webapp_auth_service.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/controllers/web/passport.py b/api/controllers/web/passport.py index 3fbef1217b..61b44aa170 100644 --- a/api/controllers/web/passport.py +++ b/api/controllers/web/passport.py @@ -150,6 +150,8 @@ def exchange_token_for_existing_web_user(app_code: str, enterprise_user_decoded: "app_code": site.code, "user_id": user_id, "end_user_id": end_user.id, + "auth_type": auth_type, + "granted_at": int(datetime.now(UTC).timestamp()), "token_source": "webapp", "exp": exp, } diff --git a/api/services/webapp_auth_service.py b/api/services/webapp_auth_service.py index dde02a915b..b73463c29f 100644 --- a/api/services/webapp_auth_service.py +++ b/api/services/webapp_auth_service.py @@ -1,6 +1,5 @@ import random from datetime import UTC, datetime, timedelta -from time import time from typing import Any, Optional, cast from configs import dify_config @@ -110,7 +109,6 @@ class WebAppAuthService: "session_id": account.email, "token_source": "webapp_login_token", "auth_type": "internal", - "granted_at": int(time()), "exp": exp, }