@ofidj/generator-fidj 1.7.0 → 1.7.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.
@@ -293,8 +293,13 @@ function render() {
293
293
  return;
294
294
  }
295
295
  // The provider handed this person here to answer a question. Nothing else
296
- // this app might want to show belongs on the screen until they have.
296
+ // this app might want to show belongs on the screen until they have — the
297
+ // shell's own header and page margins included: chrome that says "you are
298
+ // inside the console" reads as furniture from the wrong room above a question
299
+ // about whether you are anyone at all. Same class the shell's other
300
+ // standalone screens use, so one rule keeps covering them all.
297
301
  if (interactionId) {
302
+ document.body.classList.add("signin-view");
298
303
  if (interactionFailed) {
299
304
  root.innerHTML = `<section class="card"><p role="alert" class="error">${escape(message)}</p><p><a href="#/signin">Back to sign in</a></p></section>`;
300
305
  return;
@@ -438,7 +443,10 @@ function render() {
438
443
 
439
444
  // Forgetting the address it remembered and handing the person back to a
440
445
  // session it never ended would recognise them again: the offer has to reach
441
- // the provider, not just this browser's memory.
446
+ // the provider, not just this browser's memory. Asking for re-authentication
447
+ // is how it says so, and the provider reads it as this person saying they are
448
+ // not the one it knows — it ends that session when it hands the screen over,
449
+ // so walking away from the form does not hand the old face back.
442
450
  element("forget-hint")?.addEventListener("click", () => {
443
451
  forgetSignIn(config.appId);
444
452
  if (oidc) {
@@ -733,7 +741,7 @@ function interactionScreen() {
733
741
  <label class="agreement-choice"><input type="checkbox" name="terms" value="true" required><span>I accept ${asking}'s service agreement.</span></label>
734
742
  ${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>` : ""}
735
743
  <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>
744
+ <button class="quiet" type="submit" id="not-me" name="action" value="switch" formnovalidate>Not you? Sign in with another account</button>
737
745
  <button class="quiet" type="submit" name="action" value="cancel" formnovalidate>Cancel and go back</button>
738
746
  </form>`;
739
747
 
@@ -754,16 +762,16 @@ function interactionScreen() {
754
762
  });
755
763
  // Being recognised is the point, and a dead end when the person is not who
756
764
  // 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.
765
+ // the screen that recognises them asks again on request. It goes back to the
766
+ // provider as this form's own answer, because only the provider can end the
767
+ // session doing the recognising: starting a fresh request with prompt=login
768
+ // from here asked once and left that session standing, so the back button,
769
+ // a reload, or the app's door again met the same face.
759
770
  element("not-me")?.addEventListener("click", () => {
760
771
  forgetSignIn(config.appId);
761
772
  try {
762
773
  sessionStorage.removeItem("fidj.interaction.email");
763
774
  } catch {}
764
- void (async () => {
765
- window.location.assign(await oidc!.beginLogin({prompt: "login"}));
766
- })();
767
775
  });
768
776
  element("interaction")?.addEventListener("submit", () => {
769
777
  const address = element<HTMLInputElement>("email")?.value || "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ofidj/generator-fidj",
3
- "version": "1.7.0",
3
+ "version": "1.7.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": {