Scope issue in urls

This commit is contained in:
Thomas 2022-06-30 17:22:03 +02:00
parent f59507dde3
commit d5a8612ece
2 changed files with 27 additions and 22 deletions

View File

@ -71,8 +71,8 @@ public class MastodonHelper {
public static final String RESPONSE_TYPE = "response_type"; public static final String RESPONSE_TYPE = "response_type";
public static final String SCOPE = "scope"; public static final String SCOPE = "scope";
public static final String REDIRECT_CONTENT_WEB = "fedilab://backtofedilab"; public static final String REDIRECT_CONTENT_WEB = "fedilab://backtofedilab";
public static final String OAUTH_SCOPES = "read write follow push"; public static final String OAUTH_SCOPES = "read%20write%20follow%20push";
public static final String OAUTH_SCOPES_ADMIN = "read write follow push admin:read admin:write"; public static final String OAUTH_SCOPES_ADMIN = "read%20write%20follow%20push%20admin:read%20admin:write";
public static final int ACCOUNTS_PER_CALL = 40; public static final int ACCOUNTS_PER_CALL = 40;
public static final int STATUSES_PER_CALL = 40; public static final int STATUSES_PER_CALL = 40;

View File

@ -258,6 +258,7 @@ public class FragmentLoginMain extends Fragment {
scopes, scopes,
Helper.WEBSITE_VALUE Helper.WEBSITE_VALUE
).observe(requireActivity(), app -> { ).observe(requireActivity(), app -> {
if (app != null) {
client_idLogin = app.client_id; client_idLogin = app.client_id;
client_secretLogin = app.client_secret; client_secretLogin = app.client_secret;
String redirectUrl = MastodonHelper.authorizeURL(currentInstanceLogin, client_idLogin, ((LoginActivity) requireActivity()).requestedAdmin()); String redirectUrl = MastodonHelper.authorizeURL(currentInstanceLogin, client_idLogin, ((LoginActivity) requireActivity()).requestedAdmin());
@ -280,6 +281,10 @@ public class FragmentLoginMain extends Fragment {
} }
} }
} else {
Toasty.error(requireActivity(), getString(R.string.client_error), Toasty.LENGTH_SHORT).show();
}
}); });
} }
} }