prusa3d / Prusa-Link-Web

Prusa Web interface resources
GNU General Public License v3.0
114 stars 50 forks source link

Prusalink web address based auto login shows Prusalink form, but no data. #473

Open VH-fixer opened 6 months ago

VH-fixer commented 6 months ago

When I use an autologin line on the web browser, Prusalink connects, but shows no data. No files are shown in storage. No feedback in the dashboard. Storage is blank and will not take an upload. As if the login was not finished.

http://maker:paswwwooord@192.168.01.111 is an example of the login line. MK4 firmware 5.1.2 Windows 11 Chrome Browser Asus network router RT-AX82U

I have noticed this at least since Firmware 5.0.
Picture of the storage option, showing no files. There are many files on the USB. prusalink-dead

TojikCZ commented 6 months ago

Huh, never tried this, you seem to be doing funny stuff with the address bar. Anyway, moved the issue to Prusa-Link-Web as I think the (faulty?) code is here

radium-v commented 5 months ago

I just ran into this issue - I'm trying to use the preview/progress graphic in a browser source in OBS Studio. This browser source doesn't seem to have the ability to display the login popup, so I tried the alternative method of http://<username>:<password>@<ip address> with no luck. When I try to access it this way in Chrome, the page does load, but I get this error in the console:

Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': Request cannot be constructed from a URL that includes credentials: /api/v1/info
    at main.2812ca58adec020e163e.js:1:75752
blester125 commented 4 months ago

I have this same issue, when firefox restarts you need to re-log in. I wanted to be able to have a link (in my homelab dash board) that auto-logs in.

When I use a link with the username and password firefox has a pop-up that says you are providing a log in for a website that doesn't need it. If you say ok to the message you end up at prusa link but with the same behavior mentioned above.

image

It looks like there should be some code in the section that parses the username/password from the login box that first checks of the username/password are in the url. If they are it should be extracted and the base url saved for use in later things like the fetch call that is currently throwing the error.

I'd try to make a PR fixing this but I'm not great at js and I'm not sure the best way to test this behavior, is there a way to get the printer to serve a dev js page?