From f1825ae75ed6ffed70c4749f0acfbe2c552af5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schu=CC=88ller?= Date: Thu, 9 Jul 2020 21:17:21 +0200 Subject: [PATCH] Fix token refresh --- .../peertube/adapter/ServerListAdapter.java | 7 +++++++ .../network/AccessTokenAuthenticator.java | 21 ++++++++++++++++++- .../peertube/network/RetrofitInstance.java | 2 +- .../schueller/peertube/network/Session.java | 6 ++++++ .../peertube/service/LoginService.java | 10 ++++----- app/src/main/res/values/strings.xml | 2 ++ 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java b/app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java index 1e8ba2f..bfb48b4 100644 --- a/app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java +++ b/app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java @@ -37,6 +37,7 @@ import net.schueller.peertube.R; import net.schueller.peertube.database.Server; import net.schueller.peertube.helper.APIUrlHelper; +import net.schueller.peertube.network.Session; import net.schueller.peertube.service.LoginService; @@ -89,6 +90,12 @@ public class ServerListAdapter extends RecyclerView.Adapter call2, @NonNull Throwable t2) { Log.wtf("err", t2.fillInStackTrace()); - Toast.makeText(context, context.getString(R.string.authentication_login_failed), Toast.LENGTH_LONG).show(); + Toast.makeText(context, context.getString(R.string.authentication_token_refresh_failed), Toast.LENGTH_LONG).show(); } }); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bc8e6df..b7ed2ba 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -358,6 +358,8 @@ Automated Build Time + Token refresh failed + Token refresh successful \ No newline at end of file