// Authenticate can be used by clients to get a jwt token.
// Authenticator of Auth is used in this method to authenticate a user request.
// Authorization token that is a form of `Authorization: Bearer <TOKEN>` is supplied
// in a response header.
Authenticate can be used by clients to get a jwt token.
Authenticator of Auth is used in this method to authenticate a user request.
Authorization token that is a form of `Authorization: Bearer ` is supplied
in a response header.
// Authenticate can be used by clients to get a jwt token . // Authenticator of Auth is used in this method to authenticate a user request . // Authorization token that is a form of ` Authorization : Bearer <TOKEN > ` is supplied // in a response header .
func (a Auth) Authenticate(c *gin.Context) {
	claims, err := a.Authenticator(c)
	if err != nil {
		c.Set(ErrKey, err)
		c.Status(http.StatusUnauthorized)
		c.Abort()
		return
	}
	a.respondAuthorizationHeader(c, claims)
}
func ( a Auth ) Authenticate ( c * gin . Context ) { claims , err := a . Authenticator ( c ) if err != nil { c . Set ( ErrKey , err ) c . Status ( http . StatusUnauthorized ) c . Abort ( ) return } a . respondAuthorizationHeader ( c , claims ) }
Authenticate can be used by clients to get a jwt token.
Authenticate can be used by clients to get a jwt token .