Fix Bearer
authorMikael Berthe <mikael@lilotux.net>
Wed, 12 Apr 2017 18:28:24 +0200
changeset 87 1b4653f07bfc
parent 86 ae6efea0207f
child 88 df00ec8423fe
Fix Bearer
gondole.go
--- a/gondole.go	Wed Apr 12 18:27:34 2017 +0200
+++ b/gondole.go	Wed Apr 12 18:28:24 2017 +0200
@@ -34,7 +34,9 @@
 
 	// Insert our sig
 	hdrs["User-Agent"] = fmt.Sprintf("Gondole/%s", GondoleVersion)
-	hdrs["Authorization"] = fmt.Sprintf("Bearer %s", g.Secret)
+	if g.userToken != nil {
+		hdrs["Authorization"] = fmt.Sprintf("Bearer %s", g.userToken.Access_token)
+	}
 
 	req = rest.Request{
 		BaseURL:     endPoint,