Fix issue #430 - Encoding URL does not allow to login

This commit is contained in:
Thomas 2022-11-11 10:45:33 +01:00
parent f7c7ea98ad
commit f71a73abc8
1 changed files with 2 additions and 1 deletions

View File

@ -246,13 +246,14 @@ public class FragmentLoginMain extends Fragment {
URL url = new URL(instance);
host = url.getHost();
} catch (MalformedURLException e) {
host = instance;
e.printStackTrace();
}
try {
currentInstanceLogin = URLEncoder.encode(host, "utf-8");
} catch (UnsupportedEncodingException e) {
Toasty.error(requireActivity(), getString(R.string.client_error), Toast.LENGTH_LONG).show();
currentInstanceLogin = host;
}
String scopes = ((LoginActivity) requireActivity()).requestedAdmin() ? Helper.OAUTH_SCOPES_ADMIN : Helper.OAUTH_SCOPES;
AppsVM appsVM = new ViewModelProvider(requireActivity()).get(AppsVM.class);