Fix/login 403 logged in and 401 when not logged in#711
Fix/login 403 logged in and 401 when not logged in#711SharonStrats wants to merge 23 commits intopost-milestone3mfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses the confusing 401 and 403 error messages displayed to users when they are logged out (401) or logged in but lack permissions (403). Instead of showing alarming alert() popups and throwing errors, the code now logs friendlier messages and gracefully continues execution.
Changes:
- In
ensureLoadedPreferences, the 401/unauthorized handling now sets a warning and returns context instead of showing an alert, and adds regex-based fallback matching for error messages. - In
ensureLoadedProfile, the function no longer throws when the user is not logged in; instead it logs a message and returns context. Additionally, 403/forbidden and cancel errors during profile loading are treated as non-fatal when the user is already authenticated. - Error message display in
ensureLoadedProfile's catch block is updated to use a safely extracted message string instead of accessingerr.messagedirectly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…solid-ui into fix/login-403-logged-in
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…gedInProfile Agent-Logs-Url: https://github.com/SolidOS/solid-ui/sessions/b4ca60b7-29b9-4e38-b679-9657c19bc7b0 Co-authored-by: SharonStrats <9412507+SharonStrats@users.noreply.github.com>
…eferences catch block Agent-Logs-Url: https://github.com/SolidOS/solid-ui/sessions/4b8e8c78-2b47-40ca-b1f3-fe0bf78f8017 Co-authored-by: SharonStrats <9412507+SharonStrats@users.noreply.github.com>
I get all these red 403 and 401 errors when I'm
these are quite confronting, this is an attempt at messaging instead of the confronting errors.