diff --git a/lib/core/service/paperless_server_information_service.dart b/lib/core/service/paperless_server_information_service.dart index a0fc4cb..e94c9a4 100644 --- a/lib/core/service/paperless_server_information_service.dart +++ b/lib/core/service/paperless_server_information_service.dart @@ -24,7 +24,9 @@ class PaperlessServerInformationService { final String username = jsonDecode(utf8.decode(response.bodyBytes))['username']; final String? host = - response.headers[PaperlessServerInformation.hostHeader]; + response.headers[PaperlessServerInformation.hostHeader] ?? + response.request?.headers[PaperlessServerInformation.hostHeader] ?? + ('${response.request?.url.host}:${response.request?.url.port}'); return PaperlessServerInformation( username: username, version: version, diff --git a/lib/features/login/view/widgets/password_text_field.dart b/lib/features/login/view/widgets/password_text_field.dart index 7924c5a..26d57a2 100644 --- a/lib/features/login/view/widgets/password_text_field.dart +++ b/lib/features/login/view/widgets/password_text_field.dart @@ -5,6 +5,7 @@ class ObscuredInputTextFormField extends StatefulWidget { final String label; final void Function(String?) onChanged; final FormFieldValidator? validator; + final bool enabled; const ObscuredInputTextFormField({ super.key, @@ -12,6 +13,7 @@ class ObscuredInputTextFormField extends StatefulWidget { required this.label, this.validator, this.initialValue, + this.enabled = true, }); @override @@ -33,6 +35,7 @@ class _ObscuredInputTextFormFieldState @override Widget build(BuildContext context) { return TextFormField( + enabled: widget.enabled, autovalidateMode: AutovalidateMode.onUserInteraction, validator: widget.validator, initialValue: widget.initialValue,