From 012f2af3f2c14c7ddce58322dd280421272ab564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20Wrzeszczy=C5=84ski?= Date: Tue, 27 Nov 2018 00:26:43 +0100 Subject: [PATCH] Fix login --- .../java/com/uam/wmi/findmytutor/activity/LoginActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java index 3b20983..06f1c5f 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java @@ -182,7 +182,9 @@ public class LoginActivity extends AppCompatActivity { Claim userId = jwt.getClaim("nameid"); Claim role = jwt.getClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role"); - if(!Objects.requireNonNull(role.asString()).equals("Student")){ + if(Objects.requireNonNull(role.asString()).equals("Student")){ + PrefUtils.storeIsTutor(getApplicationContext(), false); + }else{ PrefUtils.storeIsTutor(getApplicationContext(), true); } -- 2.20.1