@dflat-core/web 1.7.2091 → 1.7.2093
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.
- package/assets/images/dflat-logo.png +0 -0
- package/assets/shared.scss +1 -1
- package/assets/variables.scss +1 -2
- package/fesm2022/dflat-core-web-core-model.mjs +18 -1
- package/fesm2022/dflat-core-web-core-model.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core-services.mjs +119 -12
- package/fesm2022/dflat-core-web-core-services.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core-ux.mjs +14 -14
- package/fesm2022/dflat-core-web-core-ux.mjs.map +1 -1
- package/fesm2022/dflat-core-web-identity-data.mjs +66 -0
- package/fesm2022/dflat-core-web-identity-data.mjs.map +1 -1
- package/fesm2022/dflat-core-web-identity-model.mjs +11 -1
- package/fesm2022/dflat-core-web-identity-model.mjs.map +1 -1
- package/fesm2022/dflat-core-web-identity-root.mjs +3 -0
- package/fesm2022/dflat-core-web-identity-root.mjs.map +1 -1
- package/fesm2022/dflat-core-web-identity-ux.mjs +290 -1
- package/fesm2022/dflat-core-web-identity-ux.mjs.map +1 -1
- package/fesm2022/dflat-core-web-meta-ux.mjs +4 -4
- package/fesm2022/dflat-core-web-meta-ux.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-ux.mjs +217 -10
- package/fesm2022/dflat-core-web-system-ux.mjs.map +1 -1
- package/package.json +1 -1
- package/types/dflat-core-web-core-model.d.ts +36 -0
- package/types/dflat-core-web-core-services.d.ts +51 -2
- package/types/dflat-core-web-identity-data.d.ts +15 -1
- package/types/dflat-core-web-identity-model.d.ts +80 -4
- package/types/dflat-core-web-identity-root.d.ts +1 -0
- package/types/dflat-core-web-identity-ux.d.ts +93 -16
- package/types/dflat-core-web-system-ux.d.ts +74 -20
- package/assets/images/map/blue/kezako.png +0 -0
- package/assets/images/map/blue/kezako.svg +0 -1
- package/assets/images/map/main/kezako.png +0 -0
- package/assets/images/map/main/kezako.svg +0 -1
- package/assets/images/map/primary/kezako.png +0 -0
- package/assets/images/map/primary/kezako.svg +0 -1
|
@@ -20,6 +20,7 @@ import { Utilities } from "@dflat-core/web/core";
|
|
|
20
20
|
import * as i1 from "@angular/router";
|
|
21
21
|
import { RouterModule } from "@angular/router";
|
|
22
22
|
import * as i3 from "@dflat-core/web/core-services";
|
|
23
|
+
import { ExternalLoginService } from "@dflat-core/web/core-services";
|
|
23
24
|
import { MetaEntityKeys } from "@dflat-core/web/meta-root";
|
|
24
25
|
import { Subject, of, takeUntil } from "rxjs";
|
|
25
26
|
import { catchError, map, switchMap, takeUntil as takeUntil$1 } from "rxjs/operators";
|
|
@@ -387,6 +388,291 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
387
388
|
}]
|
|
388
389
|
}
|
|
389
390
|
});
|
|
391
|
+
var AccountSecurityComponent = class AccountSecurityComponent {
|
|
392
|
+
set googleLinkButton(element) {
|
|
393
|
+
const google = this.getProvider(ExternalLoginService.google);
|
|
394
|
+
if (element && google) this.externalLoginService.renderGoogleButton(element.nativeElement, google, (result) => this.link(result)).catch((error) => this.onExternalError(error));
|
|
395
|
+
}
|
|
396
|
+
constructor(accountDataService, authService, route, router, externalLoginService) {
|
|
397
|
+
this.accountDataService = accountDataService;
|
|
398
|
+
this.authService = authService;
|
|
399
|
+
this.route = route;
|
|
400
|
+
this.router = router;
|
|
401
|
+
this.externalLoginService = externalLoginService;
|
|
402
|
+
this.required = false;
|
|
403
|
+
this.loading = true;
|
|
404
|
+
this.code = "";
|
|
405
|
+
this.disablePassword = "";
|
|
406
|
+
this.showDisable = false;
|
|
407
|
+
this.showRegenerate = false;
|
|
408
|
+
this.message = "";
|
|
409
|
+
this.errorMessage = "";
|
|
410
|
+
this.linkedLogins = [];
|
|
411
|
+
this.providers = [];
|
|
412
|
+
}
|
|
413
|
+
ngOnInit() {
|
|
414
|
+
this.required = this.route.snapshot.queryParamMap.get("required") === "true";
|
|
415
|
+
this.load();
|
|
416
|
+
this.authService.getLoginOptions().subscribe((options) => this.providers = options?.Providers || [], () => this.providers = []);
|
|
417
|
+
this.loadLinkedLogins();
|
|
418
|
+
}
|
|
419
|
+
loadLinkedLogins() {
|
|
420
|
+
this.accountDataService.getLinkedLogins().subscribe((logins) => this.linkedLogins = logins || [], () => this.linkedLogins = []);
|
|
421
|
+
}
|
|
422
|
+
getProvider(name) {
|
|
423
|
+
return this.providers.find((p) => p.Provider === name);
|
|
424
|
+
}
|
|
425
|
+
canLink(name) {
|
|
426
|
+
return !!this.getProvider(name) && !this.linkedLogins.some((l) => l.Provider === name);
|
|
427
|
+
}
|
|
428
|
+
get isNativeApp() {
|
|
429
|
+
return !!this.externalLoginService?.isNativeApp?.();
|
|
430
|
+
}
|
|
431
|
+
linkGoogleNative() {
|
|
432
|
+
this.externalLoginService.signInWithGoogleNative(this.getProvider(ExternalLoginService.google)).then((result) => this.link(result)).catch((error) => this.onExternalError(error));
|
|
433
|
+
}
|
|
434
|
+
linkMicrosoft() {
|
|
435
|
+
this.externalLoginService.signInWithMicrosoft(this.getProvider(ExternalLoginService.microsoft)).then((result) => this.link(result)).catch((error) => this.onExternalError(error));
|
|
436
|
+
}
|
|
437
|
+
linkApple() {
|
|
438
|
+
this.externalLoginService.signInWithApple(this.getProvider(ExternalLoginService.apple)).then((result) => this.link(result)).catch((error) => this.onExternalError(error));
|
|
439
|
+
}
|
|
440
|
+
link(result) {
|
|
441
|
+
this.clearMessages();
|
|
442
|
+
this.accountDataService.linkExternal({
|
|
443
|
+
Provider: result.provider,
|
|
444
|
+
IdToken: result.idToken,
|
|
445
|
+
AuthorizationCode: result.authorizationCode,
|
|
446
|
+
RedirectUri: result.redirectUri
|
|
447
|
+
}).subscribe(() => {
|
|
448
|
+
this.message = `Compte ${result.provider} lié.`;
|
|
449
|
+
this.loadLinkedLogins();
|
|
450
|
+
}, (error) => this.errorMessage = this.readError(error, "La liaison a échoué."));
|
|
451
|
+
}
|
|
452
|
+
unlink(login) {
|
|
453
|
+
this.clearMessages();
|
|
454
|
+
this.accountDataService.unlinkExternal({ Provider: login.Provider }).subscribe(() => {
|
|
455
|
+
this.message = `Compte ${login.Provider} délié.`;
|
|
456
|
+
this.loadLinkedLogins();
|
|
457
|
+
}, (error) => this.errorMessage = this.readError(error, "La déliaison a échoué."));
|
|
458
|
+
}
|
|
459
|
+
onExternalError(error) {
|
|
460
|
+
if (this.externalLoginService.isCancellation(error)) return;
|
|
461
|
+
this.errorMessage = error?.message || "La liaison a échoué.";
|
|
462
|
+
}
|
|
463
|
+
load() {
|
|
464
|
+
this.loading = true;
|
|
465
|
+
this.accountDataService.getTwoFactorStatus().subscribe((status) => {
|
|
466
|
+
this.status = status;
|
|
467
|
+
this.required = this.required || !!status?.Required;
|
|
468
|
+
this.loading = false;
|
|
469
|
+
}, () => {
|
|
470
|
+
this.loading = false;
|
|
471
|
+
this.errorMessage = "La sécurité du compte n'est pas disponible.";
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
beginSetup() {
|
|
475
|
+
this.clearMessages();
|
|
476
|
+
this.accountDataService.beginTwoFactorSetup().subscribe((setup) => {
|
|
477
|
+
this.setup = setup;
|
|
478
|
+
this.code = "";
|
|
479
|
+
}, (error) => this.errorMessage = this.readError(error, "L'activation n'a pas pu commencer."));
|
|
480
|
+
}
|
|
481
|
+
confirmSetup() {
|
|
482
|
+
this.clearMessages();
|
|
483
|
+
this.accountDataService.confirmTwoFactorSetup({ Code: this.code }).subscribe((result) => {
|
|
484
|
+
this.recoveryCodes = result?.Codes || [];
|
|
485
|
+
this.setup = null;
|
|
486
|
+
this.code = "";
|
|
487
|
+
this.load();
|
|
488
|
+
}, () => this.errorMessage = "Code incorrect : vérifiez l'heure de votre téléphone et réessayez.");
|
|
489
|
+
}
|
|
490
|
+
disable() {
|
|
491
|
+
this.clearMessages();
|
|
492
|
+
this.accountDataService.disableTwoFactor({ Password: this.disablePassword }).subscribe(() => {
|
|
493
|
+
this.showDisable = false;
|
|
494
|
+
this.disablePassword = "";
|
|
495
|
+
this.recoveryCodes = null;
|
|
496
|
+
this.message = "La double authentification est désactivée.";
|
|
497
|
+
this.load();
|
|
498
|
+
}, () => this.errorMessage = "Mot de passe incorrect.");
|
|
499
|
+
}
|
|
500
|
+
regenerate() {
|
|
501
|
+
this.clearMessages();
|
|
502
|
+
this.accountDataService.regenerateRecoveryCodes({ Code: this.code }).subscribe((result) => {
|
|
503
|
+
this.recoveryCodes = result?.Codes || [];
|
|
504
|
+
this.showRegenerate = false;
|
|
505
|
+
this.code = "";
|
|
506
|
+
this.load();
|
|
507
|
+
}, () => this.errorMessage = "Code incorrect.");
|
|
508
|
+
}
|
|
509
|
+
revoke(device) {
|
|
510
|
+
this.clearMessages();
|
|
511
|
+
this.accountDataService.revokeTrustedDevice({ Id: device?.Id }).subscribe(() => this.load());
|
|
512
|
+
}
|
|
513
|
+
downloadRecoveryCodes() {
|
|
514
|
+
const blob = new Blob([(this.recoveryCodes || []).join("\r\n") + "\r\n"], { type: "text/plain" });
|
|
515
|
+
const url = URL.createObjectURL(blob);
|
|
516
|
+
const link = document.createElement("a");
|
|
517
|
+
link.href = url;
|
|
518
|
+
link.download = "codes-de-secours.txt";
|
|
519
|
+
link.click();
|
|
520
|
+
URL.revokeObjectURL(url);
|
|
521
|
+
}
|
|
522
|
+
acknowledgeRecoveryCodes() {
|
|
523
|
+
this.recoveryCodes = null;
|
|
524
|
+
if (this.required) this.authService.redirectLoginUser();
|
|
525
|
+
}
|
|
526
|
+
clearMessages() {
|
|
527
|
+
this.message = "";
|
|
528
|
+
this.errorMessage = "";
|
|
529
|
+
}
|
|
530
|
+
readError(error, fallback) {
|
|
531
|
+
return typeof error?.error === "string" && error.error ? error.error : fallback;
|
|
532
|
+
}
|
|
533
|
+
static {
|
|
534
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
535
|
+
minVersion: "12.0.0",
|
|
536
|
+
version: "22.2.1",
|
|
537
|
+
ngImport: i0,
|
|
538
|
+
type: AccountSecurityComponent,
|
|
539
|
+
deps: [
|
|
540
|
+
{ token: i2$2.AccountDataService },
|
|
541
|
+
{ token: i3.AuthService },
|
|
542
|
+
{ token: i1.ActivatedRoute },
|
|
543
|
+
{ token: i1.Router },
|
|
544
|
+
{ token: i3.ExternalLoginService }
|
|
545
|
+
],
|
|
546
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
static {
|
|
550
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
551
|
+
minVersion: "14.0.0",
|
|
552
|
+
version: "22.2.1",
|
|
553
|
+
type: AccountSecurityComponent,
|
|
554
|
+
isStandalone: false,
|
|
555
|
+
selector: "idy-account-security",
|
|
556
|
+
viewQueries: [{
|
|
557
|
+
propertyName: "googleLinkButton",
|
|
558
|
+
first: true,
|
|
559
|
+
predicate: ["googleLinkButton"],
|
|
560
|
+
descendants: true
|
|
561
|
+
}],
|
|
562
|
+
ngImport: i0,
|
|
563
|
+
template: "<div class=\"account-security\">\r\n <h2>Sécurité du compte</h2>\r\n\r\n <div class=\"alert alert-warning\" *ngIf=\"required && !status?.Enabled\">\r\n Votre organisation demande d'activer la double authentification pour continuer.\r\n </div>\r\n <div class=\"alert alert-success\" *ngIf=\"message\">{{ message }}</div>\r\n <div class=\"alert alert-danger\" *ngIf=\"errorMessage\">{{ errorMessage }}</div>\r\n\r\n <p *ngIf=\"loading\">Chargement…</p>\r\n\r\n <ng-container *ngIf=\"!loading && status\">\r\n <!-- Codes de secours remis une seule fois -->\r\n <section class=\"security-section\" *ngIf=\"recoveryCodes?.length\">\r\n <h3>Vos codes de secours</h3>\r\n <p>Gardez ces codes en lieu sûr : ils remplacent le code de l'application si vous perdez votre téléphone.\r\n Chacun ne sert qu'une fois. Ils ne seront plus affichés.</p>\r\n <ul class=\"recovery-codes\">\r\n <li *ngFor=\"let c of recoveryCodes\"><code>{{ c }}</code></li>\r\n </ul>\r\n <div class=\"btn-bar\">\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"downloadRecoveryCodes()\">Télécharger</button>\r\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"acknowledgeRecoveryCodes()\">J'ai noté mes codes</button>\r\n </div>\r\n </section>\r\n\r\n <!-- Double authentification inactive : activation -->\r\n <section class=\"security-section\" *ngIf=\"!status.Enabled && !recoveryCodes?.length\">\r\n <h3>Double authentification</h3>\r\n <p>Protégez votre compte : après votre mot de passe, un code à 6 chiffres affiché par une application\r\n d'authentification (Google Authenticator, Microsoft Authenticator…) vous sera demandé.</p>\r\n <button type=\"button\" class=\"btn btn-primary\" *ngIf=\"!setup\" (click)=\"beginSetup()\">Activer la double authentification</button>\r\n\r\n <form *ngIf=\"setup\" (ngSubmit)=\"sf.form.valid && confirmSetup()\" #sf=\"ngForm\" novalidate>\r\n <p>1. Scannez ce QR code avec votre application d'authentification.</p>\r\n <img class=\"qr-code\" [src]=\"setup.QrCode\" alt=\"QR code de la double authentification\">\r\n <p class=\"secret\">Ou saisissez cette clé : <code>{{ setup.Secret }}</code></p>\r\n <p>2. Saisissez le code à 6 chiffres affiché par l'application.</p>\r\n <div class=\"form-group\">\r\n <input type=\"text\" class=\"form-control two-factor-code\" name=\"code\" [(ngModel)]=\"code\"\r\n inputmode=\"numeric\" autocomplete=\"one-time-code\" maxlength=\"7\" required placeholder=\"123456\">\r\n </div>\r\n <button class=\"btn btn-primary\" [disabled]=\"!sf.form.valid\">Activer</button>\r\n </form>\r\n </section>\r\n\r\n <!-- Double authentification active -->\r\n <section class=\"security-section\" *ngIf=\"status.Enabled && !recoveryCodes?.length\">\r\n <h3>Double authentification</h3>\r\n <p>Activée le {{ status.EnableDate | date: 'dd/MM/yyyy' }}. Codes de secours restants : {{ status.RecoveryCodesLeft }}.</p>\r\n\r\n <div class=\"btn-bar\">\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"showRegenerate = !showRegenerate; showDisable = false\">Nouveaux codes de secours</button>\r\n <button type=\"button\" class=\"btn btn-outline-danger\" *ngIf=\"!required\" (click)=\"showDisable = !showDisable; showRegenerate = false\">Désactiver</button>\r\n </div>\r\n\r\n <form *ngIf=\"showRegenerate\" (ngSubmit)=\"rf.form.valid && regenerate()\" #rf=\"ngForm\" novalidate>\r\n <p>Saisissez un code de votre application : les anciens codes de secours ne serviront plus.</p>\r\n <div class=\"form-group\">\r\n <input type=\"text\" class=\"form-control two-factor-code\" name=\"regenerateCode\" [(ngModel)]=\"code\" inputmode=\"numeric\" required placeholder=\"123456\">\r\n </div>\r\n <button class=\"btn btn-primary\" [disabled]=\"!rf.form.valid\">Générer</button>\r\n </form>\r\n\r\n <form *ngIf=\"showDisable\" (ngSubmit)=\"df.form.valid && disable()\" #df=\"ngForm\" novalidate>\r\n <p>Confirmez avec votre mot de passe.</p>\r\n <div class=\"form-group\">\r\n <input type=\"password\" class=\"form-control\" name=\"disablePassword\" [(ngModel)]=\"disablePassword\" required placeholder=\"Mot de passe\">\r\n </div>\r\n <button class=\"btn btn-danger\" [disabled]=\"!df.form.valid\">Désactiver la double authentification</button>\r\n </form>\r\n </section>\r\n\r\n <!-- Connexions par un fournisseur externe (Connexion, B.5.10) -->\r\n <section class=\"security-section\" *ngIf=\"providers.length || linkedLogins.length\">\r\n <h3>Connexions</h3>\r\n <p>Comptes avec lesquels vous pouvez vous connecter à la place de votre mot de passe.</p>\r\n <table class=\"table table-sm\" *ngIf=\"linkedLogins.length\">\r\n <thead><tr><th>Fournisseur</th><th>Compte</th><th>Dernière connexion</th><th></th></tr></thead>\r\n <tbody>\r\n <tr *ngFor=\"let l of linkedLogins\">\r\n <td>{{ l.Provider }}</td>\r\n <td>{{ l.ProviderEmail || l.DisplayName }}</td>\r\n <td>{{ (l.LastLoginDate || l.CreationDate) | date: 'dd/MM/yyyy HH:mm' }}</td>\r\n <td><button type=\"button\" class=\"btn btn-link\" (click)=\"unlink(l)\">Délier</button></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div class=\"btn-bar link-buttons\">\r\n <div class=\"external-login-google\" *ngIf=\"canLink('Google') && !isNativeApp\" #googleLinkButton></div>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" *ngIf=\"canLink('Google') && isNativeApp\" (click)=\"linkGoogleNative()\">Lier un compte Google</button>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" *ngIf=\"canLink('Microsoft')\" (click)=\"linkMicrosoft()\">Lier un compte Microsoft</button>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" *ngIf=\"canLink('Apple')\" (click)=\"linkApple()\">Lier un identifiant Apple</button>\r\n </div>\r\n </section>\r\n\r\n <!-- Appareils de confiance -->\r\n <section class=\"security-section\" *ngIf=\"status.TrustedDevices?.length\">\r\n <h3>Appareils de confiance</h3>\r\n <p>Le code n'est pas redemandé sur ces appareils jusqu'à la date indiquée.</p>\r\n <table class=\"table table-sm\">\r\n <thead><tr><th>Appareil</th><th>Dernière utilisation</th><th>Jusqu'au</th><th></th></tr></thead>\r\n <tbody>\r\n <tr *ngFor=\"let d of status.TrustedDevices\">\r\n <td class=\"device-label\" [title]=\"d.Label\">{{ d.Label || 'Appareil inconnu' }}</td>\r\n <td>{{ (d.LastUseDate || d.CreationDate) | date: 'dd/MM/yyyy HH:mm' }}</td>\r\n <td>{{ d.ExpirationDate | date: 'dd/MM/yyyy' }}</td>\r\n <td><button type=\"button\" class=\"btn btn-link\" (click)=\"revoke(d)\">Retirer</button></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"revoke()\">Retirer tous les appareils</button>\r\n </section>\r\n </ng-container>\r\n</div>\r\n",
|
|
564
|
+
styles: [".account-security{max-width:720px;padding:16px}.security-section{margin-bottom:24px}.qr-code{display:block;width:200px;height:200px;margin:8px 0;background:#fff}.secret code{word-break:break-all}.two-factor-code{max-width:180px;letter-spacing:.3em}.recovery-codes{columns:2;list-style:none;padding:0}.device-label{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn-bar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}\n"],
|
|
565
|
+
dependencies: [
|
|
566
|
+
{
|
|
567
|
+
kind: "directive",
|
|
568
|
+
type: i5.NgForOf,
|
|
569
|
+
selector: "[ngFor][ngForOf]",
|
|
570
|
+
inputs: [
|
|
571
|
+
"ngForOf",
|
|
572
|
+
"ngForTrackBy",
|
|
573
|
+
"ngForTemplate"
|
|
574
|
+
]
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
kind: "directive",
|
|
578
|
+
type: i5.NgIf,
|
|
579
|
+
selector: "[ngIf]",
|
|
580
|
+
inputs: [
|
|
581
|
+
"ngIf",
|
|
582
|
+
"ngIfThen",
|
|
583
|
+
"ngIfElse"
|
|
584
|
+
]
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
kind: "directive",
|
|
588
|
+
type: i6$1.ɵNgNoValidate,
|
|
589
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
kind: "directive",
|
|
593
|
+
type: i6$1.DefaultValueAccessor,
|
|
594
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
kind: "directive",
|
|
598
|
+
type: i6$1.NgControlStatus,
|
|
599
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
kind: "directive",
|
|
603
|
+
type: i6$1.NgControlStatusGroup,
|
|
604
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
kind: "directive",
|
|
608
|
+
type: i6$1.RequiredValidator,
|
|
609
|
+
selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
|
|
610
|
+
inputs: ["required"]
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
kind: "directive",
|
|
614
|
+
type: i6$1.MaxLengthValidator,
|
|
615
|
+
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
|
|
616
|
+
inputs: ["maxlength"]
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
kind: "directive",
|
|
620
|
+
type: i6$1.NgModel,
|
|
621
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
622
|
+
inputs: [
|
|
623
|
+
"name",
|
|
624
|
+
"disabled",
|
|
625
|
+
"ngModel",
|
|
626
|
+
"ngModelOptions"
|
|
627
|
+
],
|
|
628
|
+
outputs: ["ngModelChange"],
|
|
629
|
+
exportAs: ["ngModel"]
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
kind: "directive",
|
|
633
|
+
type: i6$1.NgForm,
|
|
634
|
+
selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
|
|
635
|
+
inputs: ["ngFormOptions"],
|
|
636
|
+
outputs: ["ngSubmit"],
|
|
637
|
+
exportAs: ["ngForm"]
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
kind: "pipe",
|
|
641
|
+
type: i5.DatePipe,
|
|
642
|
+
name: "date"
|
|
643
|
+
}
|
|
644
|
+
],
|
|
645
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
650
|
+
minVersion: "12.0.0",
|
|
651
|
+
version: "22.2.1",
|
|
652
|
+
ngImport: i0,
|
|
653
|
+
type: AccountSecurityComponent,
|
|
654
|
+
decorators: [{
|
|
655
|
+
type: Component,
|
|
656
|
+
args: [{
|
|
657
|
+
selector: "idy-account-security",
|
|
658
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
659
|
+
standalone: false,
|
|
660
|
+
template: "<div class=\"account-security\">\r\n <h2>Sécurité du compte</h2>\r\n\r\n <div class=\"alert alert-warning\" *ngIf=\"required && !status?.Enabled\">\r\n Votre organisation demande d'activer la double authentification pour continuer.\r\n </div>\r\n <div class=\"alert alert-success\" *ngIf=\"message\">{{ message }}</div>\r\n <div class=\"alert alert-danger\" *ngIf=\"errorMessage\">{{ errorMessage }}</div>\r\n\r\n <p *ngIf=\"loading\">Chargement…</p>\r\n\r\n <ng-container *ngIf=\"!loading && status\">\r\n <!-- Codes de secours remis une seule fois -->\r\n <section class=\"security-section\" *ngIf=\"recoveryCodes?.length\">\r\n <h3>Vos codes de secours</h3>\r\n <p>Gardez ces codes en lieu sûr : ils remplacent le code de l'application si vous perdez votre téléphone.\r\n Chacun ne sert qu'une fois. Ils ne seront plus affichés.</p>\r\n <ul class=\"recovery-codes\">\r\n <li *ngFor=\"let c of recoveryCodes\"><code>{{ c }}</code></li>\r\n </ul>\r\n <div class=\"btn-bar\">\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"downloadRecoveryCodes()\">Télécharger</button>\r\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"acknowledgeRecoveryCodes()\">J'ai noté mes codes</button>\r\n </div>\r\n </section>\r\n\r\n <!-- Double authentification inactive : activation -->\r\n <section class=\"security-section\" *ngIf=\"!status.Enabled && !recoveryCodes?.length\">\r\n <h3>Double authentification</h3>\r\n <p>Protégez votre compte : après votre mot de passe, un code à 6 chiffres affiché par une application\r\n d'authentification (Google Authenticator, Microsoft Authenticator…) vous sera demandé.</p>\r\n <button type=\"button\" class=\"btn btn-primary\" *ngIf=\"!setup\" (click)=\"beginSetup()\">Activer la double authentification</button>\r\n\r\n <form *ngIf=\"setup\" (ngSubmit)=\"sf.form.valid && confirmSetup()\" #sf=\"ngForm\" novalidate>\r\n <p>1. Scannez ce QR code avec votre application d'authentification.</p>\r\n <img class=\"qr-code\" [src]=\"setup.QrCode\" alt=\"QR code de la double authentification\">\r\n <p class=\"secret\">Ou saisissez cette clé : <code>{{ setup.Secret }}</code></p>\r\n <p>2. Saisissez le code à 6 chiffres affiché par l'application.</p>\r\n <div class=\"form-group\">\r\n <input type=\"text\" class=\"form-control two-factor-code\" name=\"code\" [(ngModel)]=\"code\"\r\n inputmode=\"numeric\" autocomplete=\"one-time-code\" maxlength=\"7\" required placeholder=\"123456\">\r\n </div>\r\n <button class=\"btn btn-primary\" [disabled]=\"!sf.form.valid\">Activer</button>\r\n </form>\r\n </section>\r\n\r\n <!-- Double authentification active -->\r\n <section class=\"security-section\" *ngIf=\"status.Enabled && !recoveryCodes?.length\">\r\n <h3>Double authentification</h3>\r\n <p>Activée le {{ status.EnableDate | date: 'dd/MM/yyyy' }}. Codes de secours restants : {{ status.RecoveryCodesLeft }}.</p>\r\n\r\n <div class=\"btn-bar\">\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"showRegenerate = !showRegenerate; showDisable = false\">Nouveaux codes de secours</button>\r\n <button type=\"button\" class=\"btn btn-outline-danger\" *ngIf=\"!required\" (click)=\"showDisable = !showDisable; showRegenerate = false\">Désactiver</button>\r\n </div>\r\n\r\n <form *ngIf=\"showRegenerate\" (ngSubmit)=\"rf.form.valid && regenerate()\" #rf=\"ngForm\" novalidate>\r\n <p>Saisissez un code de votre application : les anciens codes de secours ne serviront plus.</p>\r\n <div class=\"form-group\">\r\n <input type=\"text\" class=\"form-control two-factor-code\" name=\"regenerateCode\" [(ngModel)]=\"code\" inputmode=\"numeric\" required placeholder=\"123456\">\r\n </div>\r\n <button class=\"btn btn-primary\" [disabled]=\"!rf.form.valid\">Générer</button>\r\n </form>\r\n\r\n <form *ngIf=\"showDisable\" (ngSubmit)=\"df.form.valid && disable()\" #df=\"ngForm\" novalidate>\r\n <p>Confirmez avec votre mot de passe.</p>\r\n <div class=\"form-group\">\r\n <input type=\"password\" class=\"form-control\" name=\"disablePassword\" [(ngModel)]=\"disablePassword\" required placeholder=\"Mot de passe\">\r\n </div>\r\n <button class=\"btn btn-danger\" [disabled]=\"!df.form.valid\">Désactiver la double authentification</button>\r\n </form>\r\n </section>\r\n\r\n <!-- Connexions par un fournisseur externe (Connexion, B.5.10) -->\r\n <section class=\"security-section\" *ngIf=\"providers.length || linkedLogins.length\">\r\n <h3>Connexions</h3>\r\n <p>Comptes avec lesquels vous pouvez vous connecter à la place de votre mot de passe.</p>\r\n <table class=\"table table-sm\" *ngIf=\"linkedLogins.length\">\r\n <thead><tr><th>Fournisseur</th><th>Compte</th><th>Dernière connexion</th><th></th></tr></thead>\r\n <tbody>\r\n <tr *ngFor=\"let l of linkedLogins\">\r\n <td>{{ l.Provider }}</td>\r\n <td>{{ l.ProviderEmail || l.DisplayName }}</td>\r\n <td>{{ (l.LastLoginDate || l.CreationDate) | date: 'dd/MM/yyyy HH:mm' }}</td>\r\n <td><button type=\"button\" class=\"btn btn-link\" (click)=\"unlink(l)\">Délier</button></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <div class=\"btn-bar link-buttons\">\r\n <div class=\"external-login-google\" *ngIf=\"canLink('Google') && !isNativeApp\" #googleLinkButton></div>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" *ngIf=\"canLink('Google') && isNativeApp\" (click)=\"linkGoogleNative()\">Lier un compte Google</button>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" *ngIf=\"canLink('Microsoft')\" (click)=\"linkMicrosoft()\">Lier un compte Microsoft</button>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" *ngIf=\"canLink('Apple')\" (click)=\"linkApple()\">Lier un identifiant Apple</button>\r\n </div>\r\n </section>\r\n\r\n <!-- Appareils de confiance -->\r\n <section class=\"security-section\" *ngIf=\"status.TrustedDevices?.length\">\r\n <h3>Appareils de confiance</h3>\r\n <p>Le code n'est pas redemandé sur ces appareils jusqu'à la date indiquée.</p>\r\n <table class=\"table table-sm\">\r\n <thead><tr><th>Appareil</th><th>Dernière utilisation</th><th>Jusqu'au</th><th></th></tr></thead>\r\n <tbody>\r\n <tr *ngFor=\"let d of status.TrustedDevices\">\r\n <td class=\"device-label\" [title]=\"d.Label\">{{ d.Label || 'Appareil inconnu' }}</td>\r\n <td>{{ (d.LastUseDate || d.CreationDate) | date: 'dd/MM/yyyy HH:mm' }}</td>\r\n <td>{{ d.ExpirationDate | date: 'dd/MM/yyyy' }}</td>\r\n <td><button type=\"button\" class=\"btn btn-link\" (click)=\"revoke(d)\">Retirer</button></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"revoke()\">Retirer tous les appareils</button>\r\n </section>\r\n </ng-container>\r\n</div>\r\n",
|
|
661
|
+
styles: [".account-security{max-width:720px;padding:16px}.security-section{margin-bottom:24px}.qr-code{display:block;width:200px;height:200px;margin:8px 0;background:#fff}.secret code{word-break:break-all}.two-factor-code{max-width:180px;letter-spacing:.3em}.recovery-codes{columns:2;list-style:none;padding:0}.device-label{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn-bar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}\n"]
|
|
662
|
+
}]
|
|
663
|
+
}],
|
|
664
|
+
ctorParameters: () => [
|
|
665
|
+
{ type: i2$2.AccountDataService },
|
|
666
|
+
{ type: i3.AuthService },
|
|
667
|
+
{ type: i1.ActivatedRoute },
|
|
668
|
+
{ type: i1.Router },
|
|
669
|
+
{ type: i3.ExternalLoginService }
|
|
670
|
+
],
|
|
671
|
+
propDecorators: { googleLinkButton: [{
|
|
672
|
+
type: ViewChild,
|
|
673
|
+
args: ["googleLinkButton"]
|
|
674
|
+
}] }
|
|
675
|
+
});
|
|
390
676
|
var BaseDeviceTokenComponent = class BaseDeviceTokenComponent extends BaseComponent {
|
|
391
677
|
getTitle() {
|
|
392
678
|
return "Jetons d'appareil";
|
|
@@ -5036,6 +5322,7 @@ const components = [
|
|
|
5036
5322
|
ActivateComponent,
|
|
5037
5323
|
ResetPasswordComponent,
|
|
5038
5324
|
UserProfileComponent,
|
|
5325
|
+
AccountSecurityComponent,
|
|
5039
5326
|
RoleEditorComponent,
|
|
5040
5327
|
UserRoleComponent,
|
|
5041
5328
|
UserPermissionComponent,
|
|
@@ -5082,6 +5369,7 @@ var IdentityUxModule = class IdentityUxModule {
|
|
|
5082
5369
|
ActivateComponent,
|
|
5083
5370
|
ResetPasswordComponent,
|
|
5084
5371
|
UserProfileComponent,
|
|
5372
|
+
AccountSecurityComponent,
|
|
5085
5373
|
RoleEditorComponent,
|
|
5086
5374
|
UserRoleComponent,
|
|
5087
5375
|
UserPermissionComponent,
|
|
@@ -5122,6 +5410,7 @@ var IdentityUxModule = class IdentityUxModule {
|
|
|
5122
5410
|
ActivateComponent,
|
|
5123
5411
|
ResetPasswordComponent,
|
|
5124
5412
|
UserProfileComponent,
|
|
5413
|
+
AccountSecurityComponent,
|
|
5125
5414
|
RoleEditorComponent,
|
|
5126
5415
|
UserRoleComponent,
|
|
5127
5416
|
UserPermissionComponent,
|
|
@@ -5250,6 +5539,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5250
5539
|
])] }]
|
|
5251
5540
|
}]
|
|
5252
5541
|
});
|
|
5253
|
-
export { ActivateComponent, BaseDeviceTokenComponent, BasePresentationProfileAssignmentComponent, BaseRoleComponent, BaseRolePermissionComponent, BaseUserAccountComponent, BaseUserAccountLoginComponent, BaseUserAccountRoleComponent, BaseUserAccountTokenComponent, BaseUserFavoriteComponent, BaseUserGroupComponent, BaseUserGroupDefinitionComponent, BaseUserHistoryComponent, BaseUserPermissionViewComponent, BaseUserSessionComponent, DeviceTokenComponent, IdentityGeneratedComponents, IdentityGeneratedRoutes, IdentityGeneratedSectionService, IdentityGeneratedSelectors, IdentityRoutingModule, IdentityUxModule, MustMatch, PresentationProfileAssignmentComponent, ResetPasswordComponent, RoleComponent, RoleEditorComponent, RolePermissionComponent, RolePermissionGrid, USER_ACCOUNT_SECTIONS, UserAccountComponent, UserAccountEditorComponent, UserAccountLoginComponent, UserAccountRoleComponent, UserAccountTokenComponent, UserActionService, UserFavoriteComponent, UserGroupComponent, UserGroupDefinitionComponent, UserGroupEditorComponent, UserHistoryComponent, UserPermissionComponent, UserPermissionViewComponent, UserProfileAccountComponent, UserProfileComponent, UserRoleComponent, UserSessionComponent };
|
|
5542
|
+
export { AccountSecurityComponent, ActivateComponent, BaseDeviceTokenComponent, BasePresentationProfileAssignmentComponent, BaseRoleComponent, BaseRolePermissionComponent, BaseUserAccountComponent, BaseUserAccountLoginComponent, BaseUserAccountRoleComponent, BaseUserAccountTokenComponent, BaseUserFavoriteComponent, BaseUserGroupComponent, BaseUserGroupDefinitionComponent, BaseUserHistoryComponent, BaseUserPermissionViewComponent, BaseUserSessionComponent, DeviceTokenComponent, IdentityGeneratedComponents, IdentityGeneratedRoutes, IdentityGeneratedSectionService, IdentityGeneratedSelectors, IdentityRoutingModule, IdentityUxModule, MustMatch, PresentationProfileAssignmentComponent, ResetPasswordComponent, RoleComponent, RoleEditorComponent, RolePermissionComponent, RolePermissionGrid, USER_ACCOUNT_SECTIONS, UserAccountComponent, UserAccountEditorComponent, UserAccountLoginComponent, UserAccountRoleComponent, UserAccountTokenComponent, UserActionService, UserFavoriteComponent, UserGroupComponent, UserGroupDefinitionComponent, UserGroupEditorComponent, UserHistoryComponent, UserPermissionComponent, UserPermissionViewComponent, UserProfileAccountComponent, UserProfileComponent, UserRoleComponent, UserSessionComponent };
|
|
5254
5543
|
|
|
5255
5544
|
//# sourceMappingURL=dflat-core-web-identity-ux.mjs.map
|