func BearerExtractor(r *http.Request) (string, error) {
	token := r.Header.Get("Authorization")
	if token == "" {
		return "", ErrEmptyToken
	}
	parts := strings.Split(token, " ")
	if len(parts) != 2 || strings.ToLower(parts[0]) != "bearer" || parts[1] == "" {
		return "", ErrTokenMalformed
	}
	return parts[1], nil
}
// BearerExtractor gets the jwt token from the `Authorization` header
BearerExtractor gets the jwt token from the `Authorization` header
// BearerExtractor gets the jwt token from the ` Authorization ` header
func BearerExtractor(r *http.Request) (string, error) {
	token := r.Header.Get("Authorization")
	if token == "" {
		return "", ErrEmptyToken
	}
	parts := strings.Split(token, " ")
	if len(parts) != 2 || strings.ToLower(parts[0]) != "bearer" || parts[1] == "" {
		return "", ErrTokenMalformed
	}
	return parts[1], nil
}
func BearerExtractor ( r * http . Request ) ( string , error ) { token := r . Header . Get ( " " ) if token == " " { return " " , ErrEmptyToken } parts := strings . Split ( token , " " ) if len ( parts ) != 2 || strings . ToLower ( parts [ 0 ] ) != " " || parts [ 1 ] == " " { return " " , ErrTokenMalformed } return parts [ 1 ] , nil }
BearerExtractor gets the jwt token from the `Authorization` header
BearerExtractor gets the jwt token from the ` Authorization ` header