From 51a877e8d7ce3f0be8c1f6731c71f2fc42453dfe Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 18 Apr 2020 12:14:08 +1000 Subject: [PATCH] Update API function to grab user token - https://github.com/inventree/InvenTree/pull/735 --- lib/api.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api.dart b/lib/api.dart index b2d8eaeb..d61c9977 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -231,7 +231,7 @@ class InvenTreeAPI { // Clear out the token _token = ""; - response = await post(_URL_GET_TOKEN, body: {"username": _username, "password": _password}).catchError((error) { + response = await get(_URL_GET_TOKEN).timeout(Duration(seconds: 10)).catchError((error) { print("Error requesting token:"); print(error); return false;