Skip to content

Commit

Permalink
Removeed loggings that are used for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Shengle-Dai committed Nov 18, 2024
1 parent f3c2d77 commit 815a8ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 2 additions & 8 deletions game/lib/api/game_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,22 +252,16 @@ class ApiClient extends ChangeNotifier {
queryParameters: {'idToken': idToken},
);
final response = await http.get(uri);
print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');

if (response.statusCode == 200) {
final responseData = jsonDecode(response.body);
if (responseData['exists'] == true) {
print('User exists in the database.');
return true;
} else {
print('User does not exist.');
return false;
}
} else {
print('Failed to check user. Status code: ${response.statusCode}');
return false;
}
print('Failed to check user. Status code: ${response.statusCode}');
return false;
} catch (e) {
print('Error occurred while checking user: $e');
return false;
Expand Down
4 changes: 0 additions & 4 deletions game/lib/splash_page/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,14 @@ class SplashPageWidget extends StatelessWidget {
await apiClient.checkUserExists(idToken ?? "");
if (userExists) {
// User exists, proceed with the login process
print("User exists, connecting...");
final gRelogResult =
await client.connectGoogleNoRegister(account);

if (gRelogResult != null) {
print("Login successful, navigating to home...");
return;
}
} else {
// User does not exist, navigate to registration page
print(
"User does not exist, navigating to registration...");
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => RegisterPageWidget(
Expand Down

0 comments on commit 815a8ec

Please sign in to comment.