Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JWT_REFRESH_TOKEN = "YYELq6utge8Z9C8ynHawaHqcRpV6z33QT2mgfNdhL7porH4VPH3t3ppDSdprpzrMGNSKsmEK4aoFaarNmPByWFytEdLjBsLv"
View Source
var JWT_TOKEN_SECRET = "ZHTU3oHo6XButkt89ZkJRVUKcWPXDzbLU5UaGA3xYPpY6ASB873GXRJgXQp3pWTATNbNHtufS22xdLYrKf4NqCy5nNaKRryd"
Functions ¶
func CreateUser ¶
func CreateUser(ar UserRequest) (model.User, string)
Types ¶
type AuthRequest ¶
type CustomClaim ¶
type CustomClaim struct { Email string `json:"email"` jwt.StandardClaims }
type TokenRequest ¶
type TokenRequest struct {
Token string `json:"token"`
}
type TokenResponse ¶
type TokenResponse struct { Status bool `json:"status"` Token string `json:"token"` RefreshToken string `json:"refresh_token"` }
func RefreshToken ¶
func RefreshToken(tr string) (TokenResponse, string)
func ValidateUser ¶
func ValidateUser(ar AuthRequest) (TokenResponse, string)
type UserNameRequest ¶
type UserNameRequest struct {
UserName string `json:"username"`
}
type UserRequest ¶
type ValidationResponse ¶
func ValidateToken ¶
func ValidateToken(tr string) (ValidationResponse, string)
Click to show internal directories.
Click to hide internal directories.