This commit is contained in:
Stefan Schüller 2018-12-31 20:32:22 +01:00
parent 536dd626a9
commit 9cc108827f
3 changed files with 16 additions and 12 deletions

View File

@ -421,6 +421,7 @@ public class VideoListActivity extends AppCompatActivity {
if (!Session.getInstance().isLoggedIn()) {
Intent intent = new Intent(this, LoginActivity.class);
this.startActivity(intent);
return false;
} else {
if (!isLoading) {
@ -430,9 +431,9 @@ public class VideoListActivity extends AppCompatActivity {
subscriptions = true;
loadVideos(currentStart, count, sort, filter);
}
return true;
}
return true;
case R.id.navigation_account:
//Log.v(TAG, "navigation_account");
@ -446,7 +447,7 @@ public class VideoListActivity extends AppCompatActivity {
this.startActivity(intent);
}
return true;
return false;
}
return false;
});

View File

@ -41,11 +41,14 @@ public class AuthorizationInterceptor implements Interceptor {
if (session.isLoggedIn()) {
// if (mainResponse.code() == 401 || mainResponse.code() == 403) {
if (mainResponse.code() == 401 || mainResponse.code() == 403) {
// session.invalidate();
// return mainResponse;
// }
Log.v("Authorization", "Intercept code: " + mainResponse.code());
}
// add authentication header to each request if we are logged in
Request.Builder builder = mainRequest.newBuilder().header("Authorization", session.getToken()).
method(mainRequest.method(), mainRequest.body());
mainResponse = chain.proceed(builder.build());

View File

@ -10,26 +10,26 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="net.schueller.peertube.activity.LoginActivity">
<!-- Login progress -->
<ProgressBar
android:id="@+id/login_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:visibility="gone" />
<ScrollView
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/email_login_form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Alpha! Login is still in heavy development and may not work correctly!"/>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">