Skip to content

Commit

Permalink
fix: trim login field padding
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Oct 29, 2023
1 parent d056dbf commit 286ef83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/components/desktop_login/login_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TokenLoginForm extends HookConsumerWidget {
return;
}
final cookieHeader =
"sp_dc=${directCodeController.text}; sp_key=${keyCodeController.text}";
"sp_dc=${directCodeController.text.trim()}; sp_key=${keyCodeController.text.trim()}";

authenticationNotifier.setCredentials(
await AuthenticationCredentials.fromCookie(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/lastfm_login/lastfm_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class LastFMLoginPage extends HookConsumerWidget {
return;
}
await scrobblerNotifier.login(
username.text,
username.text.trim(),
password.text,
);
router.pop();
Expand Down
4 changes: 3 additions & 1 deletion lib/provider/authentication_provider.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:convert';

import 'package:fl_query/fl_query.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:http/http.dart';
Expand Down Expand Up @@ -51,7 +52,8 @@ class AuthenticationCredentials {
),
);
} catch (e) {
if (rootNavigatorKey?.currentContext != null) {
if (rootNavigatorKey?.currentContext != null &&
await QueryClient.connectivity.isConnected) {
showPromptDialog(
context: rootNavigatorKey!.currentContext!,
title: rootNavigatorKey!.currentContext!.l10n
Expand Down

0 comments on commit 286ef83

Please sign in to comment.