1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Revert "fix: redirect to login if stored credentials are invalid"

This commit is contained in:
Claus Vium 2021-04-10 10:21:21 +02:00 committed by GitHub
parent a025771410
commit e04a9699a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -425,18 +425,14 @@ class AppRouter {
onRequestFail(e, data) {
const apiClient = this;
// 401 means the credentials are broken
if (data.status === 401) {
console.debug('Invalid stored credentials, redirecting to login');
appRouter.showLocalLogin(apiClient.serverId());
} else if (data.status === 403) {
if (data.status === 403) {
if (data.errorCode === 'ParentalControl') {
const isCurrentAllowed = appRouter.currentRouteInfo ? (appRouter.currentRouteInfo.route.anonymous || appRouter.currentRouteInfo.route.startup) : true;
const isCurrentAllowed = this.currentRouteInfo ? (this.currentRouteInfo.route.anonymous || this.currentRouteInfo.route.startup) : true;
// Bounce to the login screen, but not if a password entry fails, obviously
if (!isCurrentAllowed) {
appRouter.showForcedLogoutMessage(globalize.translate('AccessRestrictedTryAgainLater'));
appRouter.showLocalLogin(apiClient.serverId());
this.showForcedLogoutMessage(globalize.translate('AccessRestrictedTryAgainLater'));
this.showLocalLogin(apiClient.serverId());
}
}
}