Explorar el Código

Merge pull request #72 from sethdmoore/actually-fix-login-crash

Fix Login crash by returning immediately, fixes #46
Bruce hace 9 años
padre
commit
abcba14abe
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      restapi.go

+ 3 - 0
restapi.go

@@ -108,6 +108,9 @@ func (s *Session) Login(email string, password string) (token string, err error)
 	}{email, password}
 	}{email, password}
 
 
 	response, err := s.Request("POST", LOGIN, data)
 	response, err := s.Request("POST", LOGIN, data)
+	if err != nil {
+		return "", err
+	}
 
 
 	temp := struct {
 	temp := struct {
 		Token string `json:"token"`
 		Token string `json:"token"`