token_extraction.go
func FromHeader(r *http.Request) (*jwt.JSONWebToken, error) {
	if r == nil {
		return nil, ErrNilRequest
	}
	raw := ""
	if h := r.Header.Get("Authorization"); len(h) > 7 && strings.EqualFold(h[0:7], "BEARER ") {
		raw = h[7:]
	}
	if raw == "" {
		return nil, ErrTokenNotFound
	}
	return jwt.ParseSigned(raw)
}
func FromHeader(r *http.Request) (*jwt.JSONWebToken, error) {
	if r == nil {
		return nil, ErrNilRequest
	}
	raw := ""
	if h := r.Header.Get("Authorization"); len(h) > 7 && strings.EqualFold(h[0:7], "BEARER ") {
		raw = h[7:]
	}
	if raw == "" {
		return nil, ErrTokenNotFound
	}
	return jwt.ParseSigned(raw)
}
func FromHeader ( r * http . Request ) ( * jwt . JSONWebToken , error ) { if r == nil { return nil , ErrNilRequest } raw := " " if h := r . Header . Get ( " " ) ; len ( h ) > 7 && strings . EqualFold ( h [ 0 : 7 ] , " " ) { raw = h [ 7 : ] } if raw == " " { return nil , ErrTokenNotFound } return jwt . ParseSigned ( raw ) }
// FromHeader looks for the request in the
// authentication header or call ParseMultipartForm
// if not present.
// TODO: Implement parsing form data.
FromHeader looks for the request in the authentication header or call ParseMultipartForm if not present . TODO : Implement parsing form data .