mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Small improvements
This commit is contained in:
parent
08b7ff5afc
commit
3c4876ef0f
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue