Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deauthentication not recognised by the client #919

Open
jtojnar opened this issue Apr 18, 2017 · 13 comments
Open

Deauthentication not recognised by the client #919

jtojnar opened this issue Apr 18, 2017 · 13 comments
Labels

Comments

@jtojnar
Copy link
Member

jtojnar commented Apr 18, 2017

  1. Log in to selfoss
  2. Delete the PHPSESSID cookie
  3. Switch the tag or something, the following error will be produced:

Load list error: parsererror SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Alternately, for 3., let selfoss synchronize the data, then a more precise error will be shown:

Could not sync last changes from server: error Forbidden

Ideally, selfoss would show message like “You have been signed out. Log in to continue.”

@jtojnar jtojnar added the bug label Apr 18, 2017
@niol niol mentioned this issue Jun 7, 2017
@Weishaupt
Copy link
Contributor

Weishaupt commented Jun 25, 2017

I guess I experience a similar problem. On multiple clients (using firefox, chrome mobile) I only log in once. When I reopen the page, no login dialogue is shown and the error reads

List load error: error Forbidden

If I'm using a private session, the login page is shown, and the client properly loads the feed items.

I'm on master. This bug must have been introduced since 2.17

@jtojnar
Copy link
Member Author

jtojnar commented Jun 25, 2017

Yes, it was made worse here. I should have requested for it to be fixed, did not realize it would be so annoying.

jtojnar added a commit that referenced this issue Jun 25, 2017
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.
jtojnar added a commit that referenced this issue Jun 27, 2017
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.
@virusmoere
Copy link

Still not working for me on the current dev version.

@niol
Copy link
Collaborator

niol commented Jun 25, 2018

Works for me. Can you detail how you make it fail and the corresponding error message?

@virusmoere
Copy link

virusmoere commented Jun 25, 2018

It is enough to delete the PHPSESSID cookie. After that I get the "No items loaded, reload?" message on the site and in the dev tools I can see calls on "https://url/?offset=0&itemsPerPage=50&search=&type=unread&tag=&source=&sourcesNav=false&ajax=true" that are answered with 403 unauthorized - "an error occured".

@niol
Copy link
Collaborator

niol commented Jun 25, 2018

If I login, delete the PHPSESSID cookie, click on a tag or a filter, I get a "your session has expired" red banner and the login screen, as expected.

@virusmoere
Copy link

Not for me:
selfoss

My config.ini for reference:
; see https://selfoss.aditu.de for more information about ; the configuration parameters [globals] db_type=sqlite db_file=data/sqlite/selfoss.db db_host=localhost db_database=selfoss db_username=root db_password= db_port= db_prefix= logger_destination=file:data/logs/default.log logger_level=ERROR items_perpage=50 items_lifetime=30 base_url=https://*** username=*** password=*** salt=*** public= html_title=selfoss rss_title=selfoss feed rss_max_items=300 rss_mark_as_read=0 homepage=unread language=0 auto_mark_as_read=1 auto_collapse=0 auto_stream_more=1 anonymizer= use_system_font= share=gtfpde wallabag= wallabag_version=1 allow_public_update_access=1 unread_order= load_images_on_mobile=0 auto_hide_read_on_mobile=0 env_prefix=selfoss_ camo_domain= camo_key= scroll_to_article_header=1 show_thumbnails=1

@niol
Copy link
Collaborator

niol commented Jun 25, 2018

Can you double check the version you are running and the js version loaded in your browser? Because I cannot find any failure on my setup.

@virusmoere
Copy link

virusmoere commented Jun 25, 2018

I switched back to 2.18 stable as a test, cleared all browser cache and testing with Chrome Dev tools with cache disabled. Same error.

jQuery JavaScript Library v2.2.4
$().jquery "2.2.4"

@niol
Copy link
Collaborator

niol commented Jun 25, 2018

Please ensure latest js by deleting public/all.js and ensuring the new autogenerated file gets loaded by the browser.

@virusmoere
Copy link

Still the same :-(

@jtojnar
Copy link
Member Author

jtojnar commented Jun 25, 2018

Can you change DEBUG to 1 in common.php and look on the response body in the network tools?

@virusmoere
Copy link

Sure:

Ein Fehler ist aufgetreten: HTTP 403 (GET /?offset=0&itemsPerPage=50&search=&type=unread&tag=&source=&sourcesNav=false&ajax=true) [vendor/bcosca/fatfree-core/f3.php:39] Base->error() [controllers/Index.php:40] controllers\BaseController->needsLoggedInOrPublicMode() [vendor/bcosca/fatfree-core/base.php:1806] controllers\Index->home() [vendor/bcosca/fatfree-core/base.php:1627] Base->call() [index.php:80] Base->run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants