@ofidj/generator-fidj 1.6.0 → 1.7.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.
@@ -436,8 +436,17 @@ function render() {
436
436
  })();
437
437
  }
438
438
 
439
+ // Forgetting the address it remembered and handing the person back to a
440
+ // session it never ended would recognise them again: the offer has to reach
441
+ // the provider, not just this browser's memory.
439
442
  element("forget-hint")?.addEventListener("click", () => {
440
443
  forgetSignIn(config.appId);
444
+ if (oidc) {
445
+ void (async () => {
446
+ window.location.assign(await oidc.beginLogin({prompt: "login"}));
447
+ })();
448
+ return;
449
+ }
441
450
  render();
442
451
  });
443
452
  void bindAgreement(element<HTMLFormElement>("signin"), config.title, config.apiEndpoint, config.appId, signInAgreementAccepted);
@@ -724,6 +733,7 @@ function interactionScreen() {
724
733
  <label class="agreement-choice"><input type="checkbox" name="terms" value="true" required><span>I accept ${asking}'s service agreement.</span></label>
725
734
  ${details.termsUri ? `<p class="fineprint"><a href="${escape(details.termsUri)}" target="_blank" rel="noopener noreferrer">Service agreement</a>${details.privacyUri ? ` · <a href="${escape(details.privacyUri)}" target="_blank" rel="noopener noreferrer">Privacy notice</a>` : ""}</p>` : ""}
726
735
  <button class="primary" type="submit" name="action" value="continue">Allow and continue</button>
736
+ <button type="button" id="not-me" class="quiet">Not you? Sign in with another account</button>
727
737
  <button class="quiet" type="submit" name="action" value="cancel" formnovalidate>Cancel and go back</button>
728
738
  </form>`;
729
739
 
@@ -742,6 +752,19 @@ function interactionScreen() {
742
752
  field.type = hidden ? "text" : "password";
743
753
  button.textContent = hidden ? "Hide" : "Show";
744
754
  });
755
+ // Being recognised is the point, and a dead end when the person is not who
756
+ // Fidj thinks — a shared computer, a second account, somebody else's tab. So
757
+ // the screen that recognises them asks again on request, which is what
758
+ // prompt=login means, rather than merely forgetting a remembered address.
759
+ element("not-me")?.addEventListener("click", () => {
760
+ forgetSignIn(config.appId);
761
+ try {
762
+ sessionStorage.removeItem("fidj.interaction.email");
763
+ } catch {}
764
+ void (async () => {
765
+ window.location.assign(await oidc!.beginLogin({prompt: "login"}));
766
+ })();
767
+ });
745
768
  element("interaction")?.addEventListener("submit", () => {
746
769
  const address = element<HTMLInputElement>("email")?.value || "";
747
770
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ofidj/generator-fidj",
3
- "version": "1.6.0",
3
+ "version": "1.7.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": {