Explorar o código

Fix error introduced by SHA: 30252123a02ab76a8f6292491281daa782239bde,
closes #66

Bruce Marriner %!s(int64=9) %!d(string=hai) anos
pai
achega
c2fd09c51d
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      restapi.go

+ 4 - 4
restapi.go

@@ -110,10 +110,10 @@ func (s *Session) Login(email string, password string) (token string, err error)
 	response, err := s.Request("POST", LOGIN, data)
 
 	temp := struct {
-		token string
+		Token string `json:"token"`
 	}{}
 	err = json.Unmarshal(response, &temp)
-	token = temp.token
+	token = temp.Token
 	return
 }
 
@@ -129,10 +129,10 @@ func (s *Session) Register(username string) (token string, err error) {
 	response, err := s.Request("POST", REGISTER, data)
 
 	temp := struct {
-		token string
+		Token string `json:"token"`
 	}{}
 	err = json.Unmarshal(response, &temp)
-	token = temp.token
+	token = temp.Token
 	return
 }