(c *gin.Context)
| 74 | } |
| 75 | |
| 76 | func 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 | |
| 92 | func IsRedirectSafe(redirectURL string, domain string) bool { |
| 93 | if redirectURL == "" { |
no outgoing calls