getmango / Mango

Mango is a self-hosted manga server and web reader
https://getmango.app
MIT License
1.69k stars 120 forks source link

[Bug Report] Redirected to /api/admin/thumbnail_progress when docker container is restarted while on admin page #267

Closed NaruZosa closed 2 years ago

NaruZosa commented 2 years ago

Describe the bug As discussed in #265: "When you visit any page without a valid auth token, Mango redirects you to the login page, and after a successful login you will be redirected back to the page you requested. In your case, you were still on the admin page when the container restarted, and the browser was still sending requests to the progress endpoint. So when the container came back online you were sent to the login page and then redirected to the page you last requested, which happened to be the JSON API."

To Reproduce Steps to reproduce the behavior:

  1. Go to the Admin page
  2. Restart the docker container
  3. Log in

Expected behavior Sent to homepage or admin page

Environment (please complete the following information):

Docker Default values, other than:

Additional context It may be best to redirect to the home page after logging in, generally speaking, as otherwise if a container is stopped, then the files are modified, when container is started again the client could experience an error. Example would be the client is reading a manga, the container is stopped, the manga is deleted, then the container is resumed.

This bug is very minor with minimal user impact.

hkalexling commented 2 years ago

This is not a bug but a design choice. In most cases this is a very useful feature - I can just reload the page, log in, and then continue from where I was. The situations you described and encountered in #265 are relatively rare so I don't really want to sacrifice this feature.

NaruZosa commented 2 years ago

Perfectly understandable, it's a rare circumstance and has minimal impact.