From 038cf5eeea10659fe12e739e97499e99a8e542b3 Mon Sep 17 00:00:00 2001 From: Valentina Kiryushkina Date: Mon, 27 Mar 2017 13:57:24 +0200 Subject: [PATCH] Initialize client before getting current user --- .../edu/learning/stepic/EduStepicAuthorizedClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduStepicAuthorizedClient.java b/python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduStepicAuthorizedClient.java index ab2bd98e4fd5..e94b9b39108b 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduStepicAuthorizedClient.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduStepicAuthorizedClient.java @@ -138,11 +138,12 @@ public class EduStepicAuthorizedClient { final StepicWrappers.TokenInfo tokenInfo = getTokens(parameters); if (tokenInfo != null) { final StepicUser user = new StepicUser(email, password, tokenInfo); + ourClient = createInitializedClient(user.getAccessToken()); + final StepicUser currentUser = getCurrentUser(); if (currentUser != null) { user.setId(currentUser.getId()); } - ourClient = createInitializedClient(user.getAccessToken()); return user; }