Skip to content

Commit

Permalink
client: Log out user instead of showing 403 Forbidden error
Browse files Browse the repository at this point in the history
Pull Request #931 moved the authentication client side, which worsened
the issue #919 by displaying error instead of the login form on opening
selfoss when user did not log out and their session expired on the
server.

This patch redirects user to login form whenever client side session is
registered and 403 Forbidden error is received.

This is a temporary fix before offline support is merged.
  • Loading branch information
jtojnar committed Jun 25, 2017
1 parent 9dd648c commit 23e7a03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion public/js/selfoss-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ selfoss.dbOnline = {
error: function(jqXHR, textStatus, errorThrown) {
if (textStatus == "abort")
return;
else if (errorThrown)
else if (selfoss.hasSession() && errorThrown === 'Forbidden') {
selfoss.ui.showError('Your session has expired');
selfoss.logout();
} else if (errorThrown)
selfoss.ui.showError('Load list error: '+
textStatus+' '+errorThrown);
selfoss.events.entries();
Expand Down
5 changes: 4 additions & 1 deletion public/js/selfoss-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ selfoss.events = {
error: function(jqXHR, textStatus, errorThrown) {
if (textStatus == "abort")
return;
else if (errorThrown)
else if (selfoss.hasSession() && errorThrown === 'Forbidden') {
selfoss.ui.showError('Your session has expired');
selfoss.logout();
} else if (errorThrown)
selfoss.ui.showError('Load list error: '+
textStatus+' '+errorThrown);
},
Expand Down

0 comments on commit 23e7a03

Please sign in to comment.