trim slash

This commit is contained in:
Daniel 2024-08-14 10:01:55 -04:00
parent b15263546e
commit e583b87e68

View file

@ -66,7 +66,12 @@ class Stillbox extends ChangeNotifier {
baseUri = Uri.parse(uri); baseUri = Uri.parse(uri);
setUris(); setUris();
} }
Uri loginUri = Uri.parse('${baseUri!}/login'); String baseUriString = baseUri.toString();
// trim trailing slash since gordio router really dislikes it
if (baseUriString.endsWith('/')) {
baseUriString = baseUriString.substring(0, baseUriString.length - 1);
}
Uri loginUri = Uri.parse('$baseUriString/login');
final form = <String, dynamic>{}; final form = <String, dynamic>{};
form['username'] = username; form['username'] = username;
form['password'] = password; form['password'] = password;