auth

package
v0.0.0-...-36cd75f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug  bool   = false
	Domain string = "pashinin.com"
)

Functions

func CheckIfTokenExpire

func CheckIfTokenExpire(c *gin.Context) (jwt.MapClaims, error)

CheckIfTokenExpire check if token expire

func LogoutEndpoint

func LogoutEndpoint(c *gin.Context)

func MeEndpoint

func MeEndpoint(c *gin.Context)

func RefreshEndpoint

func RefreshEndpoint(c *gin.Context)

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

func RefreshToken(c *gin.Context) (string, time.Time, error)

RefreshToken refresh token and check if token is expired

func Routes

func Routes(r *gin.Engine)

func Send_auth_email

func Send_auth_email(job *jdi.Job, args ...interface{}) error

func SetLogger

func SetLogger(logger *zap.Logger)

func SetToken

func SetToken(c *gin.Context, tokenValue string, maxage int)

func SigninEndpoint

func SigninEndpoint(c *gin.Context)

SigninEndpoint is used by clients to get a JWT token.

Input: {"username": "USERNAME", "password": "PASSWORD"} Reply: {"token": "TOKEN"}

func SignupEndpoint

func SignupEndpoint(c *gin.Context)

SignupEndpoint adds a new user to the models.

func SocialVK

func SocialVK(c *gin.Context)

Types

type SignupJSON

type SignupJSON struct {
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL