Resolves #549 trim spaces for device name, url and long-lived token

This commit is contained in:
Yegor Vialov
2020-05-03 13:47:11 +00:00
parent 12ba5598e4
commit 8221eceb78
2 changed files with 6 additions and 7 deletions

View File

@ -74,7 +74,7 @@ class TokenLoginPopup extends Popup {
child: TextFormField(
onSaved: (newValue) {
final storage = new FlutterSecureStorage();
storage.write(key: "hacl_llt", value: newValue).then((_) {
storage.write(key: "hacl_llt", value: newValue.trim()).then((_) {
Navigator.of(context).pop();
eventBus.fire(SettingsChangedEvent(true));
});
@ -87,7 +87,7 @@ class TokenLoginPopup extends Popup {
)
),
validator: (value) {
if (value.isEmpty) {
if (value.trim().isEmpty) {
return 'Long-lived token can\'t be emty';
}
return null;