markcraig / hdap-demo

Another try at an HDAP UI
MIT License
0 stars 0 forks source link

Fix issue/1: Alert user to authenticate if necessary #3

Closed markcraig closed 8 months ago

markcraig commented 8 months ago

When HDAP gets an invalid JWT, it responds with HTTP 401 and suggests HTTP Basic. The browser then pops up a modal to get the user to enter a username and password. On the web generally, that's a helpful workaround. But it you as an end user logged in as bjensen@example.com:hifalutin, you don't necessarily know you need to enter dc=com/dc=example/ou=People/uid=bjensen:hifalutin into the modal.

This patch works around the problem by logging the user out if the JWT has expired before issuing the request. It also adds a closable alert message to let the user know they're being logged out.

It further adds a couple more messages for HTTP 403 Unauthorized and HTTP 500+ errors.

markcraig commented 8 months ago

Going to merge this one for now