2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 10:15:32 +00:00

server / username / password now saved to local preferences

This commit is contained in:
Oliver Walters
2020-04-03 14:25:28 +11:00
parent 2ec662fdef
commit ee7ab5308e
3 changed files with 29 additions and 55 deletions

View File

@ -59,6 +59,11 @@ class InvenTreeAPI {
address = address.trim();
username = username.trim();
if (address.isEmpty || username.isEmpty || password.isEmpty) {
print("Server error: Empty details supplied");
return false;
}
// Ensure we are pointing to the correct endpoint
if (!address.endsWith("api/") || !address.endsWith("api")) {
address = path.join(address, "api");