MCPcopy Index your code
hub / github.com/gotify/server / GetUserID

Function GetUserID

auth/util.go:16–22  ·  view source on GitHub ↗

GetUserID returns the user id which was previously registered by RegisterAuthentication.

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

14
15// GetUserID returns the user id which was previously registered by RegisterAuthentication.
16func GetUserID(ctx *gin.Context) uint {
17 id := TryGetUserID(ctx)
18 if id == nil {
19 panic("token and user may not be null")
20 }
21 return *id
22}
23
24// TryGetUserID returns the user id or nil if one is not set.
25func TryGetUserID(ctx *gin.Context) *uint {

Callers 15

TestFakeAuthFunction · 0.92
GetMessagesMethod · 0.92
DeleteMessagesMethod · 0.92
DeleteMessageMethod · 0.92
CreateMessageMethod · 0.92
GetPluginsMethod · 0.92
isPluginOwnerFunction · 0.92
CreateApplicationMethod · 0.92
GetApplicationsMethod · 0.92
DeleteApplicationMethod · 0.92

Calls 1

TryGetUserIDFunction · 0.85

Tested by 2

TestFakeAuthFunction · 0.74
expectUserIDWithMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…