ActivityPods Solid-OIDC auth flow in AuthGate with pod provider picker and /login callback

This commit is contained in:
Sylvain Duchesne
2026-10-09 14:07:47 +02:00
parent e17398d86d
commit b09884d586
10 changed files with 510 additions and 68 deletions
+38
View File
@@ -0,0 +1,38 @@
/**
* Runtime configuration — values the server injects via `/festipod-config.json`.
*
* The browser bundle cannot read `process.env`, and `build.ts` only bakes in the
* shared-wallet material. Everything else the frontend needs at runtime lives
* here: backend URL, Solid-OIDC client id, and default Pod provider URL.
*
* `frontend.tsx` fetches the config endpoint and calls `setRuntimeConfig` before
* the app tree evaluates, so any module that imports this file reads the current
* values. Keeping the shape flat and env-driven lets dev/staging/prod differ
* without rebuilding.
*/
export interface RuntimeConfig {
/** URL of the Festipod backend as seen by the browser. */
backendUrl?: string;
/** Solid-OIDC `client_id`; when empty, derived as `${backendUrl}/app`. */
backendClientId?: string;
/** Default Pod provider URL; when empty, the picker asks the user. */
podProviderUrl?: string;
}
let runtimeConfig: RuntimeConfig = {};
/** Replace the runtime config. Called once by `frontend.tsx` before `App` loads. */
export function setRuntimeConfig(cfg: RuntimeConfig): void {
runtimeConfig = cfg;
}
/** The current runtime config. */
export function getRuntimeConfig(): RuntimeConfig {
return runtimeConfig;
}
/** URL of the Festipod backend, when configured. */
export function getBackendUrl(): string | undefined {
return runtimeConfig.backendUrl?.trim() || undefined;
}