Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
59eae446
Commit
59eae446
authored
Jun 23, 2025
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update user session section
parent
b8a37c72
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
25 deletions
+1
-25
auth_service.go
server/router/api/v1/auth_service.go
+0
-9
MyAccountSection.tsx
web/src/components/Settings/MyAccountSection.tsx
+1
-1
UserSessionsSection.tsx
web/src/components/Settings/UserSessionsSection.tsx
+0
-15
No files found.
server/router/api/v1/auth_service.go
View file @
59eae446
...
...
@@ -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
{
...
...
web/src/components/Settings/MyAccountSection.tsx
View file @
59eae446
...
...
@@ -48,8 +48,8 @@ const MyAccountSection = () => {
</
Popover
>
</
div
>
<
AccessTokenSection
/>
<
UserSessionsSection
/>
<
AccessTokenSection
/>
</
div
>
);
};
...
...
web/src/components/Settings/UserSessionsSection.tsx
View file @
59eae446
...
...
@@ -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 = () => {
<
th
scope=
"col"
className=
"px-3 py-2 text-left text-sm font-semibold text-gray-900 dark:text-gray-400"
>
{
t
(
"setting.user-sessions-section.device"
)
}
</
th
>
<
th
scope=
"col"
className=
"py-2 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-400"
>
{
t
(
"setting.user-sessions-section.location"
)
}
</
th
>
<
th
scope=
"col"
className=
"px-3 py-2 text-left text-sm font-semibold text-gray-900 dark:text-gray-400"
>
{
t
(
"setting.user-sessions-section.last-active"
)
}
</
th
>
...
...
@@ -131,9 +119,6 @@ const UserSessionsSection = () => {
</
div
>
</
div
>
</
td
>
<
td
className=
"whitespace-nowrap py-2 pl-4 pr-3 text-sm text-gray-900 dark:text-gray-400"
>
{
formatLocation
(
userSession
.
clientInfo
)
}
</
td
>
<
td
className=
"whitespace-nowrap px-3 py-2 text-sm text-gray-500 dark:text-gray-400"
>
<
div
className=
"flex items-center space-x-1"
>
<
ClockIcon
className=
"w-4 h-4"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment