Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultKey = "yitum.com/mall/auth" SessionKey = "AUTHUNIQUEID" // RedirectUrl should be the relative URL for your login route RedirectUrl string = "/user/login" // RedirectParam is the query string parameter that will be set // with the page the user was trying to visit before they were // intercepted. RedirectParam string = "return_url" )
Functions ¶
func AuthenticateSession ¶
AuthenticateSession will mark the session and user object as authenticated. Then the Login() user function will be called. This function should be called after you have validated a user.
func LoginRequired ¶
func LoginRequired() gin.HandlerFunc
func New ¶
func New() gin.HandlerFunc
Types ¶
type Auth ¶
type Auth struct {
Uid uint32 `json:"uid,omitempty"`
Nickname string `form:"nickname" json:"nickname,omitempty"`
Avatar string `form:"avatar" json:"avatar,omitempty"`
Password string `form:"password" json:"-"`
Gender int64 `json:"gender,omitempty"`
Birthday int64 `json:"birthday,omitempty"`
CreatedAt int64 `gorm:"column:created_time" json:"created_time,omitempty"`
UpdatedAt int64 `gorm:"column:updated_time" json:"updated_time,omitempty"`
// contains filtered or unexported fields
}
func (*Auth) IsAuthenticated ¶
Click to show internal directories.
Click to hide internal directories.