Project

General

Profile

Bug #6748

rrd_fetch_json.php returns html when user is unauthorized (causes "Error: SyntaxError: Unexpected token <")

Added by Stephen Smith 6 months ago. Updated about 1 month ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
Status_Monitoring
Target version:
Start date:
08/29/2016
Due date:
% Done:

0%

Affected version:
2.3.2
Affected Architecture:

Description

The rrd_fetch_json.php endpoint should always return json, as it normally is being requested by js or something that intends to parse it.

When the user's session expires (or if the user is unauthorized), this endpoint returns the html for the login page, causing the js that tries to parse it to error out.

To reproduce:
1. Go to status monitoring
2. Wait for the session to expire (or log out in a separate tab)
3. Press reload on the graph
4. ???
5. "Error: SyntaxError: Unexpected token <"

The endpoint should return some kind of json formatted error message, which the js can parse and either display an appropriate message or redirect the whole page to login.

History

#1 Updated by Jim Thompson 4 months ago

  • Assignee set to Jared Dillard
  • Target version set to 2.4.0

#2 Updated by Jared Dillard about 1 month ago

  • Status changed from New to Feedback

I added a better error message in the case that JSON doesn't get returned, but a hint for the user to check that they have an active session.

Also available in: Atom PDF