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

Custom List Icon Bad URL causes site to logout after 5 seconds #2512

Open
micahmills opened this issue Jun 6, 2024 · 3 comments
Open

Custom List Icon Bad URL causes site to logout after 5 seconds #2512

micahmills opened this issue Jun 6, 2024 · 3 comments
Labels

Comments

@micahmills
Copy link
Collaborator

Describe the bug
If the URL for a custom list item icon points to a resource that doesn't exist within the DT server, the response will come back as a 302 error. That for some reason clears the logged in cookie, so the later API calls, in my case the get_new_notifications_count call will fail and the user will be logged out. This will happen on every page that the icon with the faulty URL appears.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom list icon but point it to a URL that doesn't exist. In my case I was on a multisite instance so it was pointing to /wp-content/images/ instead of wp-content/themes/disciple-tools-theme-master/dt-assets/images/
  2. Load the page with that item on the front end. In the Dev tools Network tab you will see the get_new_notifications_count eventually fail and the user will be sent to the login screen.
  3. Trying to remove the item from the wp-admin seems to fail as well and I am asked to login every time I try to save the item with a new URL or delete it.

The only way I could fix this to go into the DB into the options table and edit the value for dt_field_customizations to change the URL.

@micahmills micahmills added the bug label Jun 6, 2024
@micahmills
Copy link
Collaborator Author

There are at least 2 approaches to fixing this. First, put some verification that the URL is pointing to an accessible resource when the item is saved, but if the item is deleted later we could still have the same problem. Option 2 is to figure out why the user is logged out when it hits a bad resource like this.

@corsacca
Copy link
Member

Check for new notifications every 5 mins, if that fails (auth expired) then reload.

window.fiveMinuteTimer = setInterval(function () {

The auto sign out issue i think was related to something else. I'll try to find it.

@corsacca
Copy link
Member

Still Todo: Option 2 is to figure out why the user is logged out when it hits a bad resource like this.

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

No branches or pull requests

2 participants