func extractAuthToken()

in src/handlers/helpers.go [59:68]


func extractAuthToken(r *http.Request) (string, error) {
	apiKey := r.Header.Get("Authorization")
	if apiKey == "" {
		return "", errors.New("Missing Authorization header")
	}

	// get the apikey without the Bearer prefix
	apiKey = strings.TrimPrefix(apiKey, "Bearer ")
	return apiKey, nil
}