@ofidj/generator-fidj 1.4.2 → 1.5.0

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.
@@ -407,7 +407,9 @@ function render() {
407
407
  config.title,
408
408
  config.appId,
409
409
  config.ownCredentials ? credentialFields() : "",
410
+ isFidjItself,
410
411
  );
412
+
411
413
  element("forget-hint")?.addEventListener("click", () => {
412
414
  forgetSignIn(config.appId);
413
415
  render();
@@ -588,6 +590,17 @@ const refusals: Record<string, string> = {
588
590
  refused: "That could not be completed. Please try again.",
589
591
  };
590
592
 
593
+ // Fidj's own front end, told apart by the one fact it already carries: the
594
+ // dashboard it points people to is itself. "Sign in with Fidj" is the right
595
+ // label on an app that is not Fidj; here it names a provider the person is
596
+ // standing in, and hides the form behind a click that only fetches it.
597
+ const isFidjItself = (() => {
598
+ try {
599
+ return new URL(config.dashboardUrl).origin === window.location.origin;
600
+ } catch {
601
+ return false;
602
+ }
603
+ })();
591
604
  function addressedInteraction() {
592
605
  const query = window.location.hash.slice(2).split("?")[1] || "";
593
606
  return new URLSearchParams(query).get("interaction") || "";
@@ -108,6 +108,7 @@ export function providerEntry(
108
108
  title: string,
109
109
  appId: string,
110
110
  credentials: string,
111
+ isFidjItself = false,
111
112
  ) {
112
113
  const escapeText = (value: unknown) =>
113
114
  String(value ?? "").replace(
@@ -123,10 +124,12 @@ export function providerEntry(
123
124
  ? `<p class="signin-lead">You signed in here with Fidj before. ${escapeText(title)} accounts are Fidj accounts — continue as yourself, or use another.</p>`
124
125
  : both
125
126
  ? `<p class="signin-lead">${escapeText(title)} accounts are Fidj accounts. Sign in below, or let Fidj do it on its own page — where this site never sees your password.</p>`
126
- : `<p class="signin-lead">${escapeText(title)} accounts are Fidj accounts. You will sign in — or create yours — on Fidj's own page, so this site never sees your password.</p>`;
127
+ : isFidjItself
128
+ ? `<p class="signin-lead">One account across every app that uses Fidj, and a separate set of choices for each one. Sign in, or create yours, on the next screen.</p>`
129
+ : `<p class="signin-lead">${escapeText(title)} accounts are Fidj accounts. You will sign in — or create yours — on Fidj's own page, so this site never sees your password.</p>`;
127
130
  const fidj = hint
128
131
  ? `<button class="primary" type="submit" name="entry" value="fidj">Continue as ${escapeText(hint)}</button><button type="button" id="forget-hint" class="quiet">Use a different account</button>`
129
- : `<button class="${both ? "secondary" : "primary"}" type="submit" name="entry" value="fidj">Sign in with Fidj</button>`;
132
+ : `<button class="${both ? "secondary" : "primary"}" type="submit" name="entry" value="fidj">${isFidjItself ? "Sign in" : "Sign in with Fidj"}</button>`;
130
133
  if (!both) return lead + agreementMarkup() + fidj;
131
134
  // Both doors. A remembered address puts Fidj first because it is one tap; no
132
135
  // memory puts the form first, because that is what the person came to do.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ofidj/generator-fidj",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
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": {