Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LocalLogin ¶
func LocalLogin(client *ent.Client) gin.HandlerFunc
LocalLogin godoc
@Summary Login with a local account @Schemes http https @Description Login with a local account @Tags Auth API @Accept json,mpfd @Param login body auth.UserLoginVals true "User account details" @Produce json @Success 200 {object} auth.UserModel @Header 200 {string} Cookie "`auth-cookie` contains the session token" @Router /auth/local/login [post]
func Logout ¶
func Logout(client *ent.Client) gin.HandlerFunc
Logout decodes the share session cookie and packs the session into context
func RegisterAuthEndpoints ¶
func RegisterAuthEndpoints(client *ent.Client, r *gin.RouterGroup)
Types ¶
type UserLoginVals ¶
type UserLoginVals struct { Username string `form:"username" json:"username" binding:"required" example:"admin"` Password string `form:"password" json:"password" binding:"required" example:"password123"` }
UserLoginVals model info
@Description Used as an input to the login input
type UserModel ¶
type UserModel struct { // Fields ID uuid.UUID `json:"id" example:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` // Compsole ID Username string `json:"username" example:"compsole"` // [REQUIRED] The username for the user. FirstName string `json:"first_name" example:"Default"` // [OPTIONAL] The display first name for the user. LastName string `json:"last_name" example:"User"` // [OPTIONAL] The display last name for the user. Role user.Role `json:"role" example:"USER"` // [REQUIRED] The role of the user. Admins have full access. // Edges UserToTeam *rest.TeamEdge `json:"user_to_team"` }
UserModel model info
@Description Used for User login
func UserEntToModel ¶
UserEntToModel converts the result of a User ENT query into a UserModel for API responses
Click to show internal directories.
Click to hide internal directories.