Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoSimplicity/LinkMe
/ currentUserID
Function
currentUserID
internal/api/auth.go:25–37 ·
view source on GitHub ↗
(ctx *gin.Context)
Source
from the content-addressed store, hash-verified
23
}
24
25
func
currentUserID(ctx *gin.Context) int64 {
26
user, exists := ctx.Get(
"user"
)
27
if
!exists {
28
return
0
29
}
30
31
claims, ok := user.(ijwt.UserClaims)
32
if
!ok {
33
return
0
34
}
35
36
return
claims.Uid
37
}
Callers
2
ListPub
Method · 0.85
DetailPub
Method · 0.85
Calls
1
Get
Method · 0.65
Tested by
no test coverage detected