@ofidj/generator-fidj 3.8.0 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -138,7 +138,11 @@ export function providerEntry(
138
138
  // on this path it is this site that holds the password.
139
139
  if (shape === "inline")
140
140
  return (
141
- `<p class="signin-lead">${escapeText(title)} accounts are Fidj accounts. Sign in below — ${escapeText(title)} handles your password itself on this page.</p>` +
141
+ `<p class="signin-lead">${
142
+ isFidjItself
143
+ ? "One account across every app that uses Fidj, and a separate set of choices for each one."
144
+ : `${escapeText(title)} accounts are Fidj accounts. Sign in below — ${escapeText(title)} handles your password itself on this page.`
145
+ }</p>` +
142
146
  agreementMarkup() +
143
147
  credentials
144
148
  );
package/lib/scaffold.cjs CHANGED
@@ -21,6 +21,21 @@ const escapeHtml = (value) =>
21
21
  const moduleRedirectRoot = (file) =>
22
22
  (path.posix.relative(path.posix.dirname("module/" + file), ".") || ".") + "/";
23
23
 
24
+ // Which Fidj an app points at follows the API it talks to. It used to be the
25
+ // constant https://fidj.ovh, so every app built against the sandbox API sent
26
+ // people to a different deployment with a different database, where their apps
27
+ // are not — and the sandbox console never recognised itself as Fidj, because
28
+ // recognising itself is comparing its own origin against this value.
29
+ //
30
+ // An API host named after its console (api.X serves X) says where that console
31
+ // is. One that is not says nothing, and then the default stands rather than a
32
+ // guess being invented.
33
+ function dashboardFor(api) {
34
+ return api.hostname.startsWith("api.")
35
+ ? `https://${api.hostname.slice(4)}`
36
+ : "https://fidj.ovh";
37
+ }
38
+
24
39
  function scaffold(destination, options) {
25
40
  const anonymous = options.anonymous ?? true;
26
41
  if (![true, false, "true", "false"].includes(anonymous))
@@ -182,7 +197,7 @@ function scaffold(destination, options) {
182
197
  ? new URL("/oidc", localApi).href
183
198
  : null,
184
199
  apiEndpoint: localApi,
185
- dashboardUrl: options.local ? "http://localhost:4200" : "https://fidj.ovh",
200
+ dashboardUrl: options.local ? "http://localhost:4200" : dashboardFor(api),
186
201
  title,
187
202
  releaseVersion,
188
203
  localDemo: Boolean(options.local),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ofidj/generator-fidj",
3
- "version": "3.8.0",
3
+ "version": "3.8.2",
4
4
  "description": "Generate a TypeScript app with Fidj sign-in, live server-side roles and per-app privacy.",
5
5
  "homepage": "https://fidj.ovh",
6
6
  "bugs": {