Documentation
¶
Index ¶
- func BindJSON(obj interface{}, c *gin.Context) error
- func BindWith(obj interface{}, b binding.Binding, c *gin.Context) error
- type Connector
- func (connector *Connector) CheckAccessToken(target string, context *gin.Context) (*jwt.StandardClaims, *waechter.AuthError)
- func (connector *Connector) CreateAccessToken(target string, path string, claims *jwt.StandardClaims, expires time.Duration, ...) *waechter.AuthError
- func (connector *Connector) DefaultRoutes(engine *gin.Engine)
- func (connector *Connector) Enforce(target string, path string, c *gin.Context, verify VerifyFunc, ...)
- func (connector *Connector) ForgotPassword(context *gin.Context)
- func (connector *Connector) GetAccessToken(target string, context *gin.Context) (string, *waechter.AuthError)
- func (connector *Connector) GetRefreshToken(context *gin.Context) (*waechter.User, *jwt.StandardClaims, error)
- func (connector *Connector) LoginEmail(context *gin.Context)
- func (connector *Connector) LoginUsername(context *gin.Context)
- func (connector *Connector) LoginUsernameOrEmail(context *gin.Context)
- func (connector *Connector) Register(context *gin.Context)
- func (connector *Connector) RequestVerification(context *gin.Context)
- func (connector *Connector) ResetPassword(context *gin.Context)
- func (connector *Connector) VerifyEmail(context *gin.Context)
- type HandleFunc
- type JSONResponse
- type VerifyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connector ¶
type Connector struct { Waechter *waechter.Waechter Debug bool AuthPath string Domain string Writer io.Writer ForceHTTPS bool RedirectVerifySuccess string RedirectVerifyFailed string }
Connector is used to setup gin with go-waechter
func (*Connector) CheckAccessToken ¶
func (*Connector) CreateAccessToken ¶
func (*Connector) DefaultRoutes ¶
DefaultRoutes mounts routes under the /auth/ path
func (*Connector) Enforce ¶
func (connector *Connector) Enforce(target string, path string, c *gin.Context, verify VerifyFunc, handle HandleFunc)
Enfore enforces a permission on a route
func (*Connector) ForgotPassword ¶
ForgotPassword requests a reset password email
func (*Connector) GetAccessToken ¶
func (*Connector) GetRefreshToken ¶
func (*Connector) LoginEmail ¶
LoginEmail ...
func (*Connector) LoginUsername ¶
LoginUsername ...
func (*Connector) LoginUsernameOrEmail ¶
LoginUsernameOrEmail ...
func (*Connector) RequestVerification ¶
RequestVerification ...
func (*Connector) ResetPassword ¶
ResetPassword resets the password of a user
func (*Connector) VerifyEmail ¶
VerifyEmail of a new account
type HandleFunc ¶
type HandleFunc func(claims *jwt.StandardClaims, userId string)
type JSONResponse ¶
type JSONResponse struct { Status bool `json:"status"` Err *waechter.AuthError `json:"err"` Data interface{} `json:"data"` }
JSONResponse describes the format in which data is returned from the connector
Click to show internal directories.
Click to hide internal directories.