MCPcopy 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
25func 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

ListPubMethod · 0.85
DetailPubMethod · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected