MCPcopy
hub / github.com/tinyauthapp/tinyauth / GetContext

Function GetContext

internal/utils/app_utils.go:76–90  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

74}
75
76func GetContext(c *gin.Context) (config.UserContext, error) {
77 userContextValue, exists := c.Get("context")
78
79 if !exists {
80 return config.UserContext{}, errors.New("no user context in request")
81 }
82
83 userContext, ok := userContextValue.(*config.UserContext)
84
85 if !ok {
86 return config.UserContext{}, errors.New("invalid user context in request")
87 }
88
89 return *userContext, nil
90}
91
92func IsRedirectSafe(redirectURL string, domain string) bool {
93 if redirectURL == "" {

Callers 6

TestGetContextFunction · 0.92
userContextHandlerMethod · 0.92
AuthorizeMethod · 0.92
proxyHandlerMethod · 0.92
logoutHandlerMethod · 0.92
totpHandlerMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestGetContextFunction · 0.74