Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web-admin/src/components/errors/user-facing-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export function createUserFacingError(
body: "It looks like this link is no longer active. Please reach out to the sender to request a new link.",
fatal: true,
};
} else if (status === 401) {
return {
statusCode: 401,
header: "Authentication error",
body: "Try refreshing the page. If the problem persists, try signing out and back in.",
};
} else if (status === 403) {
return {
statusCode: status,
Expand Down
1 change: 1 addition & 0 deletions web-admin/src/features/projects/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export async function fetchProjectDeploymentDetails(
instanceId: projResp.deployment?.runtimeInstanceId,
jwt: {
token: projResp.jwt,
receivedAt: Date.now(),
authContext: token ? "magic" : "user",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ export const load = async ({
// Wait for the feature flags to load
const { runtime } = await parent();

const fetchedFeatureFlags = await getFeatureFlags(runtime);
let fetchedFeatureFlags: Awaited<ReturnType<typeof getFeatureFlags>> = {};
try {
fetchedFeatureFlags = await getFeatureFlags(runtime);
} catch {
// If the runtime is unreachable or the JWT is invalid, fall back to defaults.
// The project layout's JWT refresh polling will recover on the next interval.
}

// Redirect to `/-/dashboards` if chat feature is disabled
// NOTE: In the future, we'll use user-level `ai` permissions for more granular access control
Expand Down
Loading