Documentation ¶
Index ¶
- Variables
- func CheckIfTokenExpire(c *gin.Context) (jwt.MapClaims, error)
- func LogoutEndpoint(c *gin.Context)
- func MeEndpoint(c *gin.Context)
- func RefreshEndpoint(c *gin.Context)
- func RefreshToken(c *gin.Context) (string, time.Time, error)
- func Routes(r *gin.Engine)
- func Send_auth_email(job *jdi.Job, args ...interface{}) error
- func SetLogger(logger *zap.Logger)
- func SetToken(c *gin.Context, tokenValue string, maxage int)
- func SigninEndpoint(c *gin.Context)
- func SignupEndpoint(c *gin.Context)
- func SocialVK(c *gin.Context)
- type SignupJSON
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Debug bool = false Domain string = "pashinin.com" )
Functions ¶
func CheckIfTokenExpire ¶
CheckIfTokenExpire check if token expire
func LogoutEndpoint ¶
func MeEndpoint ¶
func RefreshEndpoint ¶
RefreshHandler is used to refresh a token. The token still needs to be valid on refresh. Shall be put under an endpoint that is using the GinJWTMiddleware. Reply form: {"token": "TOKEN"}.
func RefreshToken ¶
RefreshToken refresh token and check if token is expired
func Send_auth_email ¶
func SigninEndpoint ¶
SigninEndpoint is used by clients to get a JWT token.
Input: {"username": "USERNAME", "password": "PASSWORD"} Reply: {"token": "TOKEN"}
func SignupEndpoint ¶
SignupEndpoint adds a new user to the models.
Types ¶
type SignupJSON ¶
type SignupJSON struct {
Username string `json:"username"`
}
Click to show internal directories.
Click to hide internal directories.