Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
3.67k stars 511 forks source link

display flash errors for external auths like saml or oidc on the login screen #6154

Closed xcsdm closed 2 weeks ago

xcsdm commented 1 month ago

Is your feature request related to a problem? Please describe. Seeing the flash errors either on the Login Screen or MeshCentral logs would greatly improve troubleshooting.

Describe the solution you'd like Flash errors would have drastically improved troubleshooting of #6148 and may have lead to fixing withing needing to open an issue.

Describe alternatives you've considered Seeing the errors on the login page, or in the MeshCentral logs. (docker compose logs, in my case)

Additional context Perhaps including in authlog since that can be enabled and disabled when needed.

si458 commented 3 weeks ago

image

all done! https://github.com/Ylianst/MeshCentral/commit/d7341ab153ba5a4eb9f20a9ef2f8d1cc650f84c3 https://github.com/Ylianst/MeshCentral/commit/5950b2c8297b2a9613592634a8d08c42ec8b4591

smartekIT commented 2 weeks ago

after this commit, the login dialog doesn't show up at all. Only the background and header appears without the login fields like what's in the screenshot above!!

si458 commented 2 weeks ago

@smartekIT oh dear what did I break! I'm assuming ur using the master docker image? Can u share ur config.json?

Edit. Can u check the browser developer tools? Can u See what javascript error it thinks is broken?

smartekIT commented 2 weeks ago

Thanks Simon, I'm not using docker but full install on ubuntu server. Can't check the developer tool now as I have to revert back on these files to a date before this commit to get it show up again. What I can tell you that I'm using custom background which always work until this commit!

si458 commented 2 weeks ago

Hmmm that's weird? The commit doesn't touch the background at all? Will have a look tomorrow, do u use any external auth?

Edit. Is ur desktop browser or mobile u use?

si458 commented 2 weeks ago

@smartekIT, sorry, I meant any external auth in meshcentral, like ldap, azure, google, oauth2, etc..

When u have a min (no rush) can u share ur config.json?

smartekIT commented 2 weeks ago

will try to re-update it again tomorrow and see if I can get anything from the developer tool

smartekIT commented 2 weeks ago

here is the error from developer tool: login:1 Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse () at startup (login:441:36) at onload (login:56:134)

smartekIT commented 2 weeks ago

Hi mate, please forgive me. It was Friday night and stupid me I just realized that I only applied the changes to login.handlebars and login2.handlebars files ignoring the rest of other files in the commit. I just applied the other files changes and it works now. sorry again.

si458 commented 2 weeks ago

@smartekIT dont sweat it! we all make mistakes! glad its working :)