Documentation ¶
Index ¶
- Variables
- func AuthMiddleware(cbleConfig *config.Config, client *ent.Client) gin.HandlerFunc
- func DeleteAuthCookie(c *gin.Context, cbleConfig *config.Config)
- func ForContext(ctx context.Context) (*ent.User, error)
- func Login(cbleConfig *config.Config, client *ent.Client) gin.HandlerFunc
- func Logout(cbleConfig *config.Config) gin.HandlerFunc
- type UserLoginInput
Constants ¶
This section is empty.
Variables ¶
View Source
var AUTH_REQUIRED_GQL_ERROR = &gqlerror.Error{ Message: "Authentication required to perform this action", Extensions: map[string]interface{}{ "code": 401, }, }
View Source
var PERMISSION_DENIED_GQL_ERROR = &gqlerror.Error{ Message: "User is not authorized to perform this action", Extensions: map[string]interface{}{ "code": 403, }, }
Functions ¶
func AuthMiddleware ¶
Looks up the ENT user object from the session token and injects into context
func ForContext ¶
ForContext finds the user from the context. REQUIRES Middleware to have run.
Types ¶
type UserLoginInput ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.