From 59eae4465a8707e361264b830dc1133545e38805 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 23 Jun 2025 20:12:29 +0800 Subject: [PATCH] chore: update user session section --- server/router/api/v1/auth_service.go | 9 --------- web/src/components/Settings/MyAccountSection.tsx | 2 +- .../components/Settings/UserSessionsSection.tsx | 15 --------------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/server/router/api/v1/auth_service.go b/server/router/api/v1/auth_service.go index 416d02d98..259cc76e8 100644 --- a/server/router/api/v1/auth_service.go +++ b/server/router/api/v1/auth_service.go @@ -178,15 +178,6 @@ func (s *APIV1Service) CreateSession(ctx context.Context, request *v1pb.CreateSe } func (s *APIV1Service) doSignIn(ctx context.Context, user *store.User, expireTime time.Time) error { - // Generate JWT access token for API use - accessToken, err := GenerateAccessToken(user.Email, user.ID, expireTime, []byte(s.Secret)) - if err != nil { - return status.Errorf(codes.Internal, "failed to generate access token, error: %v", err) - } - if err := s.UpsertAccessTokenToStore(ctx, user, accessToken, "user login"); err != nil { - return status.Errorf(codes.Internal, "failed to upsert access token to store, error: %v", err) - } - // Generate unique session ID for web use sessionID, err := GenerateSessionID() if err != nil { diff --git a/web/src/components/Settings/MyAccountSection.tsx b/web/src/components/Settings/MyAccountSection.tsx index 1ce983fec..4b8ba4a38 100644 --- a/web/src/components/Settings/MyAccountSection.tsx +++ b/web/src/components/Settings/MyAccountSection.tsx @@ -48,8 +48,8 @@ const MyAccountSection = () => { - + ); }; diff --git a/web/src/components/Settings/UserSessionsSection.tsx b/web/src/components/Settings/UserSessionsSection.tsx index e95fb2a16..56af2b70e 100644 --- a/web/src/components/Settings/UserSessionsSection.tsx +++ b/web/src/components/Settings/UserSessionsSection.tsx @@ -50,15 +50,6 @@ const UserSessionsSection = () => { } }; - const formatLocation = (clientInfo: UserSession["clientInfo"]) => { - if (!clientInfo) return "Unknown"; - - const parts = []; - if (clientInfo.ipAddress) parts.push(clientInfo.ipAddress); - - return parts.length > 0 ? parts.join(" • ") : "Unknown"; - }; - const formatDeviceInfo = (clientInfo: UserSession["clientInfo"]) => { if (!clientInfo) return "Unknown Device"; @@ -97,9 +88,6 @@ const UserSessionsSection = () => { {t("setting.user-sessions-section.device")} - - {t("setting.user-sessions-section.location")} - {t("setting.user-sessions-section.last-active")} @@ -131,9 +119,6 @@ const UserSessionsSection = () => { - - {formatLocation(userSession.clientInfo)} -