diff --git a/.env.example b/.env.example index f391615..36a0250 100644 --- a/.env.example +++ b/.env.example @@ -12,6 +12,10 @@ NEXT_PUBLIC_MANIFEST_RESOURCE_URI="resource.ttl" # Admin WebID used for booting the demo (replace with your WebID) NEXT_PUBLIC_ADMIN_WEBID="https://id.inrupt.com/your-webid" +# OIDC issuer URL for authentication +# Default Inrupt provider, can be changed to other Solid-compatible providers +NEXT_PUBLIC_OIDC_ISSUER="https://login.inrupt.com" + # Notes: # - Never commit secrets. This file is safe to commit because it contains placeholders only. # - For private credentials (if any), keep them in `.env` or `.env.local` which are ignored by git. diff --git a/src/Config.ts b/src/Config.ts index 54da619..003bba5 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -32,4 +32,13 @@ export class Config { return value; } + + public static get oidcIssuer(): string { + const value = process.env.NEXT_PUBLIC_OIDC_ISSUER; + if (value === undefined) { + throw new Error(`${errorTemplate}NEXT_PUBLIC_OIDC_ISSUER`); + } + + return value; + } } diff --git a/src/components/ui/ListEditor.tsx b/src/components/ui/ListEditor.tsx index 2db981e..4586bf5 100644 --- a/src/components/ui/ListEditor.tsx +++ b/src/components/ui/ListEditor.tsx @@ -178,7 +178,7 @@ export function ListEditor() { console.log("unauthenticated"); await login({ - oidcIssuer: "https://login.inrupt.com", // TODO: config + oidcIssuer: Config.oidcIssuer, clientName: "My application", }); }