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

Method GetCurrentUser

api/user.go:124–130  ·  view source on GitHub ↗

GetCurrentUser returns the current user swagger:operation GET /current/user user currentUser Return the current user. --- produces: [application/json] security: [clientTokenAuthorizationHeader: [], clientTokenHeader: [], clientTokenQuery: [], basicAuth: []] responses: 200: description:

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

122// schema:
123// $ref: "#/definitions/Error"
124func (a *UserAPI) GetCurrentUser(ctx *gin.Context) {
125 user, err := a.DB.GetUserByID(auth.GetUserID(ctx))
126 if success := successOrAbort(ctx, 500, err); !success {
127 return
128 }
129 ctx.JSON(200, toExternalUser(user))
130}
131
132// CreateUser create a user.
133// swagger:operation POST /user user createUser

Callers 1

Test_GetCurrentUserMethod · 0.80

Calls 4

GetUserIDFunction · 0.92
successOrAbortFunction · 0.85
toExternalUserFunction · 0.85
GetUserByIDMethod · 0.65

Tested by 1

Test_GetCurrentUserMethod · 0.64