Clean
This commit is contained in:
parent
b0f1c68ec3
commit
a84122a45a
|
@ -639,7 +639,7 @@ public class LoginActivity extends BaseActivity {
|
||||||
String token = resobj.get("access_token").toString();
|
String token = resobj.get("access_token").toString();
|
||||||
String refresh_token = null;
|
String refresh_token = null;
|
||||||
if (resobj.has("refresh_token"))
|
if (resobj.has("refresh_token"))
|
||||||
refresh_token = resobj.get("refresh_token").toString();
|
refresh_token = resobj.getString("refresh_token");
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
editor.putString(Helper.PREF_KEY_OAUTH_TOKEN, token);
|
editor.putString(Helper.PREF_KEY_OAUTH_TOKEN, token);
|
||||||
|
|
|
@ -713,7 +713,7 @@ public class PeertubeAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Verifiy credential of the authenticated user *synchronously*
|
* Verifiy PeertubeInformation of the authenticated user *synchronously*
|
||||||
* @return Account
|
* @return Account
|
||||||
*/
|
*/
|
||||||
public PeertubeInformation getPeertubeInformation() throws HttpsConnection.HttpsConnectionException {
|
public PeertubeInformation getPeertubeInformation() throws HttpsConnection.HttpsConnectionException {
|
||||||
|
@ -791,13 +791,7 @@ public class PeertubeAPI {
|
||||||
peertubeInformation.setTranslations(_translations);
|
peertubeInformation.setTranslations(_translations);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (KeyManagementException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return peertubeInformation;
|
return peertubeInformation;
|
||||||
|
@ -921,15 +915,7 @@ public class PeertubeAPI {
|
||||||
refresh_token = resobj.get("refresh_token").toString();
|
refresh_token = resobj.get("refresh_token").toString();
|
||||||
newValues.put("access_token", token);
|
newValues.put("access_token", token);
|
||||||
newValues.put("refresh_token", refresh_token);
|
newValues.put("refresh_token", refresh_token);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException | HttpsConnection.HttpsConnectionException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (KeyManagementException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return newValues;
|
return newValues;
|
||||||
|
|
Loading…
Reference in New Issue