mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Small improvements
This commit is contained in:
@@ -383,15 +383,15 @@ public class FragmentOAuth extends FragmentBase {
|
||||
String address = args.getString("address");
|
||||
|
||||
if (jwt != null) {
|
||||
// https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens
|
||||
String[] segments = jwt.split("\\.");
|
||||
if (segments.length > 1)
|
||||
try {
|
||||
String payload = new String(Base64.decode(segments[1], Base64.DEFAULT));
|
||||
Log.i("jwt payload=" + payload);
|
||||
EntityLog.log(context, "jwt payload=" + payload);
|
||||
JSONObject jpayload = new JSONObject(payload);
|
||||
if (jpayload.has("email")) {
|
||||
String email = jpayload.getString("email");
|
||||
Log.i("jwt email=" + email);
|
||||
if (!TextUtils.isEmpty(email))
|
||||
address = email;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user