From 55088f2b23ba8ae9e61211fb5c1665ce2c91c64d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 18 May 2019 16:37:46 +0200 Subject: [PATCH] Provide user credentials when signing in --- lib/helpers/users_helper.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/helpers/users_helper.dart b/lib/helpers/users_helper.dart index fa6524c..210ea98 100644 --- a/lib/helpers/users_helper.dart +++ b/lib/helpers/users_helper.dart @@ -20,7 +20,9 @@ class UsersHelper { Future _downloadInfo(List users) async { // Execute the request final response = await APIRequest( - uri: "user/getInfoMultiple", args: {"usersID": users.join(",")}).exec(); + uri: "user/getInfoMultiple", + needLogin: true, + args: {"usersID": users.join(",")}).exec(); // Check if the request did not execute correctly if (response.code != 200) return null; @@ -63,24 +65,22 @@ class UsersHelper { /// the server, otherwise cached data will be used if available Future getUsersInfo(List users, {bool forceDownload = false}) async { - List toDownload = List(); UsersList list = UsersList(); // Check cache - for(int userID in users){ - if(!forceDownload && await _usersDatabaseHelper.has(userID)) + for (int userID in users) { + if (!forceDownload && await _usersDatabaseHelper.has(userID)) list.add(await _usersDatabaseHelper.get(userID)); else toDownload.add(userID); } // Process download if required - if(toDownload.length > 0) { + if (toDownload.length > 0) { final downloadedList = await _downloadInfo(toDownload); - if(downloadedList == null) - return null; + if (downloadedList == null) return null; list.addAll(downloadedList); }