Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce confusing 401/403 experiences by improving how SolidOS handles authentication-related fetch failures and by avoiding an initial fetch of / when the app is loaded at the bare root URL.
Changes:
- Detect 401/403-like errors during outline expansion and display a login-oriented message instead of a raw error.
- Update main page initialization so that visiting bare
/(without an explicit target URI) attempts to land on the logged-in user’s WebID/profile rather than dereferencing/. - Add an optional “safe landing” override via
localStorage.solidosSafeLandingUrifor logged-in users when a WebID isn’t immediately available.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/outline/manager.js |
Adds auth-error detection to replace raw 401/403 errors with a clearer user-facing message during outline fetch failures. |
src/mainPage/index.ts |
Changes startup navigation logic at the bare app root to avoid fetching / and optionally redirect logged-in users to profile/safe landing. |
💡 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.
Comment on lines
2114
to
2119
| const message = UI.widgets.errorMessageBlock( | ||
| dom, | ||
| detail, | ||
| '#fee', | ||
| errObj instanceof Error ? errObj : undefined | ||
| isAuthError ? 'You need to log in to see this resource.' : detail, | ||
| isAuthError ? '#d8d8d8' : '#fee', | ||
| !isAuthError && errObj instanceof Error ? errObj : undefined | ||
| ) |
| const isLoggedIn = !!(authSession.info && authSession.info.isLoggedIn) | ||
| const isBareAppRoot = locationUrl.pathname === '/' && !locationUrl.search && !locationUrl.hash | ||
|
|
||
| if (isBareAppRoot && !hasExplicitUriArg && !explicitUriQuery) { |
Comment on lines
+40
to
+42
| const fallbackUrl = new URL(configuredLandingUri, locationUrl.origin) | ||
| if (!(fallbackUrl.origin === locationUrl.origin && fallbackUrl.pathname === '/')) { | ||
| outliner.GotoSubject(store.sym(fallbackUrl.toString()), true, undefined, true, undefined) |
Comment on lines
+2111
to
+2112
| const isAuthError = errorStatus === 401 || errorStatus === 403 || | ||
| errorStatus === '401' || errorStatus === '403' || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket SolidOS/solidos#263
Some changes we could make to improve the flow and provide better user experience.