This commit is contained in:
tom79 2019-11-24 18:10:04 +01:00
parent b0f1c68ec3
commit a84122a45a
2 changed files with 4 additions and 18 deletions

View File

@ -639,7 +639,7 @@ public class LoginActivity extends BaseActivity {
String token = resobj.get("access_token").toString();
String refresh_token = null;
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.Editor editor = sharedpreferences.edit();
editor.putString(Helper.PREF_KEY_OAUTH_TOKEN, token);

View File

@ -713,7 +713,7 @@ public class PeertubeAPI {
}
/***
* Verifiy credential of the authenticated user *synchronously*
* Verifiy PeertubeInformation of the authenticated user *synchronously*
* @return Account
*/
public PeertubeInformation getPeertubeInformation() throws HttpsConnection.HttpsConnectionException {
@ -791,13 +791,7 @@ public class PeertubeAPI {
peertubeInformation.setTranslations(_translations);
}
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (JSONException e) {
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
e.printStackTrace();
}
return peertubeInformation;
@ -921,15 +915,7 @@ public class PeertubeAPI {
refresh_token = resobj.get("refresh_token").toString();
newValues.put("access_token", token);
newValues.put("refresh_token", refresh_token);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
} catch (HttpsConnection.HttpsConnectionException e) {
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException | HttpsConnection.HttpsConnectionException e) {
e.printStackTrace();
}
return newValues;