mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 06:31:17 +00:00
Workaround OAuth browser missing
This commit is contained in:
parent
3b9e74b79c
commit
e7b7228494
1 changed files with 7 additions and 6 deletions
|
@ -54,6 +54,7 @@ import androidx.preference.PreferenceManager;
|
|||
import net.openid.appauth.AppAuthConfiguration;
|
||||
import net.openid.appauth.AuthState;
|
||||
import net.openid.appauth.AuthorizationException;
|
||||
import net.openid.appauth.AuthorizationManagementActivity;
|
||||
import net.openid.appauth.AuthorizationRequest;
|
||||
import net.openid.appauth.AuthorizationResponse;
|
||||
import net.openid.appauth.AuthorizationService;
|
||||
|
@ -358,14 +359,14 @@ public class FragmentOAuth extends FragmentBase {
|
|||
try {
|
||||
authIntent = authService.getAuthorizationRequestIntent(authRequest);
|
||||
} catch (ActivityNotFoundException ex) {
|
||||
Log.e(ex);
|
||||
throw new ActivityNotFoundException("Browser not found");
|
||||
Log.w(ex);
|
||||
authIntent =
|
||||
AuthorizationManagementActivity.createStartForResultIntent(
|
||||
context, authRequest,
|
||||
new Intent(Intent.ACTION_VIEW, authRequest.toUri()));
|
||||
}
|
||||
|
||||
if (authIntent.resolveActivity(pm) == null) // action whitelisted
|
||||
throw new ActivityNotFoundException(authIntent.toString());
|
||||
else
|
||||
startActivityForResult(authIntent, ActivitySetup.REQUEST_OAUTH);
|
||||
startActivityForResult(authIntent, ActivitySetup.REQUEST_OAUTH);
|
||||
} catch (Throwable ex) {
|
||||
showError(ex);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue