@ofidj/generator-fidj 3.7.3 → 3.7.5
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {agreementMarkup, bindAgreement, acceptedAgreement, signInErrorMessage, providerEntry, rememberSignIn, forgetSignIn} from "./service-agreement";
|
|
1
|
+
import {agreementMarkup, bindAgreement, acceptedAgreement, signInErrorMessage, providerEntry, rememberSignIn, forgetSignIn, signInHint} from "./service-agreement";
|
|
2
2
|
import { FidjNodeService, FidjOidcClient } from "@ofidj/node";
|
|
3
3
|
import config from "../app.config.json";
|
|
4
4
|
import "./style.css";
|
|
@@ -269,6 +269,13 @@ function startModule() {
|
|
|
269
269
|
for (const script of mount.scripts) {
|
|
270
270
|
const element = document.createElement("script");
|
|
271
271
|
if (script.module) element.type = "module";
|
|
272
|
+
// A script created here carries async = true by default, so these execute
|
|
273
|
+
// in whatever order the network returns them. An app's polyfills have to
|
|
274
|
+
// run before its entry point — Angular boots without Zone.js otherwise,
|
|
275
|
+
// throws NG0908 and paints nothing, which reaches the person as a blank
|
|
276
|
+
// page, intermittently, with nothing said. Clearing it restores the order
|
|
277
|
+
// they were inserted in, which is the order the app's own document had.
|
|
278
|
+
element.async = false;
|
|
272
279
|
element.src = script.src;
|
|
273
280
|
document.body.appendChild(element);
|
|
274
281
|
}
|
|
@@ -407,6 +414,13 @@ function render() {
|
|
|
407
414
|
anonymous = true;
|
|
408
415
|
navigate("content");
|
|
409
416
|
});
|
|
417
|
+
// A remembered address is how the entry offers "Continue as <them>". Every
|
|
418
|
+
// sign-out this shell owns forgets it, because on a shared computer still
|
|
419
|
+
// being offered by name after leaving is the whole difference. A console that
|
|
420
|
+
// signs out through the SDK takes another path and forgot nothing, so the
|
|
421
|
+
// entry kept offering somebody who had left — the SDK records that this
|
|
422
|
+
// browser asked to be signed out, and that is the same statement.
|
|
423
|
+
if (oidc?.signedOutHere()) forgetSignIn(config.appId);
|
|
410
424
|
if (oidc && element("signin"))
|
|
411
425
|
element("signin")!.innerHTML = providerEntry(
|
|
412
426
|
config.title,
|
|
@@ -490,7 +504,18 @@ function render() {
|
|
|
490
504
|
return;
|
|
491
505
|
}
|
|
492
506
|
void action(async () => {
|
|
493
|
-
if (oidc && throughFidj) {
|
|
507
|
+
if (oidc && throughFidj) {
|
|
508
|
+
// "Continue as <them>" promises to carry on as that person, and handed
|
|
509
|
+
// them over to an empty email field — so the promise cost a second
|
|
510
|
+
// typing of the address it had just shown. The screen prefills from
|
|
511
|
+
// this, and nothing was writing it.
|
|
512
|
+
try {
|
|
513
|
+
const remembered = signInHint(config.appId);
|
|
514
|
+
if (remembered) sessionStorage.setItem("fidj.interaction.email", remembered);
|
|
515
|
+
} catch {}
|
|
516
|
+
window.location.assign(await oidc.beginLogin());
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
494
519
|
if (oidc && (!email || !password)) {
|
|
495
520
|
throw new Error("Enter your email and password, or sign in with Fidj.");
|
|
496
521
|
}
|