// respondAuthorizationHeader create a authorization token and set it in the response header.
respondAuthorizationHeader create a authorization token and set it in the response header.
// respondAuthorizationHeader create a authorization token and set it in the response header .
func (a Auth) respondAuthorizationHeader(c *gin.Context, claims MapClaims) {
	newToken := jwt.New(jwt.GetSigningMethod(a.SigningMethod))
	newToken.Claims = a.refreshExp(claims)
	tokenString, err := newToken.SignedString(a.SecretKey)
	if err != nil {
		c.Set(ErrKey, err)
		c.Status(http.StatusInternalServerError)
		return
	}
	c.Header(authorizationHeaderKey, authorizationHeaderPrefix+tokenString)
	c.Status(http.StatusOK)
}
func ( a Auth ) respondAuthorizationHeader ( c * gin . Context , claims MapClaims ) { newToken := jwt . New ( jwt . GetSigningMethod ( a . SigningMethod ) ) newToken . Claims = a . refreshExp ( claims ) tokenString , err := newToken . SignedString ( a . SecretKey ) if err != nil { c . Set ( ErrKey , err ) c . Status ( http . StatusInternalServerError ) return } c . Header ( authorizationHeaderKey , authorizationHeaderPrefix + tokenString ) c . Status ( http . StatusOK ) }
respondAuthorizationHeader create a authorization token and set it in the response header.
respondAuthorizationHeader create a authorization token and set it in the response header .