MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / userFromContext

Method userFromContext

api/pkg/handlers/handler.go:115–120  ·  view source on GitHub ↗
(c fiber.Ctx)

Source from the content-addressed store, hash-verified

113}
114
115func (h *handler) userFromContext(c fiber.Ctx) entities.AuthContext {
116 if tokenUser, ok := c.Locals(middlewares.ContextKeyAuthUserID).(entities.AuthContext); ok && !tokenUser.IsNoop() {
117 return tokenUser
118 }
119 panic("user does not exist in context.")
120}
121
122func (h *handler) userIDFomContext(c fiber.Ctx) entities.UserID {
123 return h.userFromContext(c).ID

Callers 15

userIDFomContextMethod · 0.95
authorizePhoneAPIKeyMethod · 0.95
IndexMethod · 0.80
UpsertMethod · 0.80
UpsertFCMTokenMethod · 0.80
StoreMethod · 0.80
UpdateMethod · 0.80
UpdateMethod · 0.80
StoreMethod · 0.80
ShowMethod · 0.80
UpdateMethod · 0.80
subscriptionUpdateURLMethod · 0.80

Calls 1

IsNoopMethod · 0.80

Tested by

no test coverage detected