Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
fix(enroll): fill profile and session token directly
Browse files Browse the repository at this point in the history
Signed-off-by: Rafa Hernandez <[email protected]>
  • Loading branch information
rafaelje authored and Hector Rondon committed Jul 6, 2018
1 parent 6d03608 commit 3faac93
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ public void run() {
}

JSONObject jsonSession = new JSONObject(data);
cache.setSessionToken(jsonSession.getString("session_token"));
final String sessionToken = jsonSession.getString("session_token");
cache.setSessionToken(sessionToken);

// STEP 2 get full session information
HashMap<String, String> header = new HashMap();
header.put(SESSION_TOKEN, cache.getSessionToken());
header.put(SESSION_TOKEN, sessionToken);
header.put(ACCEPT,APPLICATION_JSON);
header.put(CONTENT_TYPE,APPLICATION_JSON + ";" + CHARSET);
header.put(USER_AGENT,FLYVE_MDM);
Expand All @@ -164,7 +165,7 @@ public void run() {
cache.setProfileId(profileId);

// STEP 3 Activated the profile
final String dataActiveProfile = getSyncWebData(routes.changeActiveProfile(cache.getProfileId()), "POST", header);
final String dataActiveProfile = getSyncWebData(routes.changeActiveProfile(profileId), "POST", header);
final String errorActiveProfile = manageError(dataActiveProfile);
if(!errorActiveProfile.equals("")) {
EnrollmentHelper.runOnUI(new Runnable() {
Expand All @@ -176,7 +177,7 @@ public void run() {
// Success
EnrollmentHelper.runOnUI(new Runnable() {
public void run() {
callback.onSuccess(cache.getSessionToken());
callback.onSuccess(sessionToken);
}
});
}
Expand Down

0 comments on commit 3faac93

Please sign in to comment.