@acontplus/ng-auth 2.3.0 → 2.3.1
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/fesm2022/acontplus-ng-auth.mjs +21 -21
- package/package.json +9 -9
|
@@ -119,10 +119,10 @@ class AuthHttpRepository extends AuthRepository {
|
|
|
119
119
|
listTenants() {
|
|
120
120
|
return this.http.get(`${this.URL}tenants`);
|
|
121
121
|
}
|
|
122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0
|
|
123
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0
|
|
122
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthHttpRepository, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
123
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthHttpRepository, providedIn: 'root' });
|
|
124
124
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthHttpRepository, decorators: [{
|
|
126
126
|
type: Injectable,
|
|
127
127
|
args: [{
|
|
128
128
|
providedIn: 'root',
|
|
@@ -316,10 +316,10 @@ class AuthTokenRepositoryImpl {
|
|
|
316
316
|
}
|
|
317
317
|
return undefined;
|
|
318
318
|
}
|
|
319
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0
|
|
320
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0
|
|
319
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthTokenRepositoryImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
320
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthTokenRepositoryImpl, providedIn: 'root' });
|
|
321
321
|
}
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0
|
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthTokenRepositoryImpl, decorators: [{
|
|
323
323
|
type: Injectable,
|
|
324
324
|
args: [{
|
|
325
325
|
providedIn: 'root',
|
|
@@ -435,10 +435,10 @@ class AuthUrlRedirect {
|
|
|
435
435
|
return null;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0
|
|
439
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0
|
|
438
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthUrlRedirect, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
439
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthUrlRedirect, providedIn: 'root' });
|
|
440
440
|
}
|
|
441
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0
|
|
441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthUrlRedirect, decorators: [{
|
|
442
442
|
type: Injectable,
|
|
443
443
|
args: [{
|
|
444
444
|
providedIn: 'root',
|
|
@@ -515,10 +515,10 @@ class CsrfApi {
|
|
|
515
515
|
clearCsrfToken() {
|
|
516
516
|
this.csrfToken = null;
|
|
517
517
|
}
|
|
518
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0
|
|
519
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0
|
|
518
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: CsrfApi, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
519
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: CsrfApi, providedIn: 'root' });
|
|
520
520
|
}
|
|
521
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0
|
|
521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: CsrfApi, decorators: [{
|
|
522
522
|
type: Injectable,
|
|
523
523
|
args: [{
|
|
524
524
|
providedIn: 'root',
|
|
@@ -1019,10 +1019,10 @@ class AuthState {
|
|
|
1019
1019
|
ngOnDestroy() {
|
|
1020
1020
|
this.stopTokenRefreshTimer();
|
|
1021
1021
|
}
|
|
1022
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0
|
|
1023
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0
|
|
1022
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1023
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthState, providedIn: 'root' });
|
|
1024
1024
|
}
|
|
1025
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0
|
|
1025
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AuthState, decorators: [{
|
|
1026
1026
|
type: Injectable,
|
|
1027
1027
|
args: [{
|
|
1028
1028
|
providedIn: 'root',
|
|
@@ -1217,10 +1217,10 @@ class Login {
|
|
|
1217
1217
|
socialLogin(provider) {
|
|
1218
1218
|
this.loginWithProvider(provider);
|
|
1219
1219
|
}
|
|
1220
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0
|
|
1221
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: Login, isStandalone: true, selector: "acp-login", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showRegisterButton: { classPropertyName: "showRegisterButton", publicName: "showRegisterButton", isSignal: true, isRequired: false, transformFunction: null }, showRememberMe: { classPropertyName: "showRememberMe", publicName: "showRememberMe", isSignal: true, isRequired: false, transformFunction: null }, enableDomainDiscovery: { classPropertyName: "enableDomainDiscovery", publicName: "enableDomainDiscovery", isSignal: true, isRequired: false, transformFunction: null }, showSocialLogin: { classPropertyName: "showSocialLogin", publicName: "showSocialLogin", isSignal: true, isRequired: false, transformFunction: null }, additionalSigninControls: { classPropertyName: "additionalSigninControls", publicName: "additionalSigninControls", isSignal: true, isRequired: false, transformFunction: null }, additionalSignupControls: { classPropertyName: "additionalSignupControls", publicName: "additionalSignupControls", isSignal: true, isRequired: false, transformFunction: null }, additionalSigninFields: { classPropertyName: "additionalSigninFields", publicName: "additionalSigninFields", isSignal: true, isRequired: false, transformFunction: null }, additionalSignupFields: { classPropertyName: "additionalSignupFields", publicName: "additionalSignupFields", isSignal: true, isRequired: false, transformFunction: null }, footerContent: { classPropertyName: "footerContent", publicName: "footerContent", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-card class=\"mat-elevation-z8 p-4 rounded\">\n <mat-card-header>\n <mat-card-title class=\"text-center\">{{ title() }}</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n @if (isLoginMode()) {\n <form [formGroup]=\"signinForm\" (ngSubmit)=\"signIn()\" class=\"d-flex flex-column gap-3\">\n <mat-form-field class=\"w-100\">\n <mat-label>Usuario</mat-label>\n <input matInput type=\"text\" placeholder=\"Ingrese su usuario\" formControlName=\"email\" />\n </mat-form-field>\n\n <!-- Show discovery message if OAuth is required -->\n @if (enableDomainDiscovery() && discoveryResult() && discoveryResult()!.requiresOAuth) {\n <div class=\"discovery-message\">\n @if (discoveryResult()!.provider) {\n <p>\n <mat-icon>info</mat-icon>\n Su organizaci\u00F3n utiliza {{ discoveryResult()!.provider }} para la autenticaci\u00F3n\n </p>\n @if (!discoveryResult()!.allowPasswordLogin) {\n <p class=\"warning\">Por favor, use el bot\u00F3n de inicio de sesi\u00F3n corporativo</p>\n }\n }\n </div>\n }\n\n <!-- Password field - only show if allowed -->\n @if (showPasswordLogin()) {\n <mat-form-field class=\"w-100\">\n <mat-label>Contrase\u00F1a</mat-label>\n <input\n matInput\n type=\"password\"\n placeholder=\"Ingrese su contrase\u00F1a\"\n formControlName=\"password\"\n autocomplete=\"current-password\"\n />\n </mat-form-field>\n\n <!-- Remember Me checkbox - conditional -->\n @if (showRememberMe()) {\n <div class=\"d-flex align-items-center mt-2\">\n <mat-checkbox formControlName=\"rememberMe\"> Recordarme </mat-checkbox>\n </div>\n }\n\n <!-- Additional signin fields -->\n <ng-container *ngTemplateOutlet=\"additionalSigninFields()\"></ng-container>\n\n <div class=\"d-flex justify-content-center mt-3\">\n <button\n mat-raised-button\n color=\"primary\"\n [disabled]=\"!signinForm.valid || isLoading()\"\n type=\"submit\"\n class=\"w-100\"\n >\n @if (isLoading()) {\n Ingresando...\n } @else {\n <ng-container>Ingresar <mat-icon>login</mat-icon></ng-container>\n }\n </button>\n </div>\n }\n\n <!-- OAuth/SSO Login Buttons -->\n @if (\n enableDomainDiscovery() &&\n discoveryResult() &&\n discoveryResult()!.requiresOAuth &&\n discoveryResult()!.provider\n ) {\n <div class=\"d-flex justify-content-center mt-3\">\n <button\n mat-raised-button\n color=\"accent\"\n type=\"button\"\n (click)=\"loginWithProvider()\"\n class=\"w-100 oauth-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon>business</mat-icon>\n Iniciar sesi\u00F3n con {{ discoveryResult()!.provider }}\n </button>\n </div>\n }\n\n <!-- Social Login Divider -->\n @if (showSocialLogin() && showPasswordLogin()) {\n <mat-divider class=\"my-3\"></mat-divider>\n <p class=\"text-center text-muted\">O continuar con</p>\n }\n\n <!-- Social Login Buttons -->\n @if (showSocialLogin() && !discoveryResult()?.requiresOAuth) {\n <div class=\"social-login-buttons\">\n <button\n mat-stroked-button\n type=\"button\"\n (click)=\"socialLogin('google')\"\n class=\"w-100 social-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon svgIcon=\"google\"></mat-icon>\n Google\n </button>\n\n <button\n mat-stroked-button\n type=\"button\"\n (click)=\"socialLogin('microsoft')\"\n class=\"w-100 social-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\n Microsoft\n </button>\n\n <button\n mat-stroked-button\n type=\"button\"\n (click)=\"socialLogin('github')\"\n class=\"w-100 social-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon svgIcon=\"github\"></mat-icon>\n GitHub\n </button>\n </div>\n }\n\n <div class=\"text-center mt-2\">\n @if (showRegisterButton()) {\n <button mat-button type=\"button\" (click)=\"switchMode()\">\n \u00BFNo tienes cuenta? Reg\u00EDstrate\n </button>\n }\n </div>\n </form>\n } @else {\n <form [formGroup]=\"signupForm\" (ngSubmit)=\"registerUser()\" class=\"d-flex flex-column gap-3\">\n <mat-form-field class=\"w-100\">\n <mat-label>Nombre</mat-label>\n <input\n matInput\n type=\"text\"\n placeholder=\"Ingrese su nombre\"\n formControlName=\"displayName\"\n />\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Email</mat-label>\n <input matInput type=\"email\" placeholder=\"Ingrese su email\" formControlName=\"email\" />\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Contrase\u00F1a</mat-label>\n <input\n matInput\n type=\"password\"\n placeholder=\"Ingrese su contrase\u00F1a\"\n formControlName=\"password\"\n autocomplete=\"new-password\"\n />\n </mat-form-field>\n\n <!-- Additional signup fields -->\n <ng-container *ngTemplateOutlet=\"additionalSignupFields()\"></ng-container>\n\n <div class=\"d-flex justify-content-center mt-3\">\n <button\n mat-raised-button\n color=\"primary\"\n [disabled]=\"!signupForm.valid || isLoading()\"\n type=\"submit\"\n class=\"w-100\"\n >\n @if (isLoading()) {\n Registrando...\n } @else {\n <ng-container>Registrarse <mat-icon>person_add</mat-icon></ng-container>\n }\n </button>\n </div>\n\n <div class=\"text-center mt-2\">\n <button mat-button type=\"button\" (click)=\"switchMode()\">\n \u00BFYa tienes cuenta? Inicia sesi\u00F3n\n </button>\n </div>\n </form>\n }\n @if (errorMessage()) {\n <div class=\"alert alert-danger mt-3\" role=\"alert\">{{ errorMessage() }}</div>\n }\n </mat-card-content>\n @if (hasFooterContent()) {\n <mat-card-footer>\n <ng-container *ngTemplateOutlet=\"footerContent()\"></ng-container>\n </mat-card-footer>\n }\n</mat-card>\n", styles: [":host{display:flex;justify-content:center;align-items:center;min-height:100vh;width:100%;padding:16px;box-sizing:border-box}:host mat-card{width:100%;max-width:400px;border-radius:12px;box-shadow:0 8px 32px #0000001a}:host mat-card-header{text-align:center;margin-bottom:20px}:host mat-card-title{font-size:24px;font-weight:600;color:var(--mat-sys-primary, #6750a4)}:host mat-form-field{width:100%}:host mat-button{border-radius:8px}:host .w-100{width:100%}:host .d-flex{display:flex}:host .flex-column{flex-direction:column}:host .gap-3{gap:12px}:host .justify-content-center{justify-content:center}:host .discovery-message{padding:12px;background-color:#e3f2fd;border-radius:8px;margin-bottom:16px}:host .discovery-message p{margin:4px 0;display:flex;align-items:center;gap:8px;font-size:14px;color:#1565c0}:host .discovery-message p mat-icon{font-size:18px;width:18px;height:18px}:host .discovery-message p.warning{color:#f57c00;font-weight:500}:host .oauth-button{background-color:var(--mat-sys-secondary-container, #e8def8);color:var(--mat-sys-on-secondary-container, #1d192b);font-weight:500}:host .oauth-button mat-icon{margin-right:8px}:host .oauth-button:hover:not([disabled]){background-color:var(--mat-sys-secondary, #625b71);color:var(--mat-sys-on-secondary, #ffffff)}:host .social-login-buttons{display:flex;flex-direction:column;gap:12px;margin-top:16px}:host .social-button{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px 24px;font-weight:500;border:1.5px solid var(--mat-sys-outline, #79747e);transition:all .2s ease}:host .social-button mat-icon{width:20px;height:20px;font-size:20px}:host .social-button:hover:not([disabled]){background-color:var(--mat-sys-surface-variant, #e7e0ec);border:1.5px solid var(--mat-sys-primary, #6750a4)}:host .social-button[disabled]{opacity:.5;cursor:not-allowed}:host .text-muted{color:var(--mat-sys-outline, #79747e);font-size:14px;margin:8px 0}:host mat-divider{margin:16px 0}:host .align-items-center{align-items:center}:host .mt-3{margin-top:12px}:host .mt-2{margin-top:8px}:host .text-center{text-align:center}:host .p-4{padding:16px}:host .rounded{border-radius:12px}:host .m-t-10{margin-top:10px}:host .alert-danger{background-color:var(--mat-sys-error-container, #ffdad6);color:var(--mat-sys-on-error-container, #410002);padding:12px;border-radius:4px;border:1px solid var(--mat-sys-error, #ba1a1a)}:host .row{display:flex;flex-wrap:wrap;margin:0 -15px}:host .col-xs-12,:host .col-sm-12,:host .col-md-12{flex:0 0 100%;max-width:100%;padding:0 15px}:host .social{display:flex;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, 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]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatCardFooter, selector: "mat-card-footer" }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Login, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: Login, isStandalone: true, selector: "acp-login", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showRegisterButton: { classPropertyName: "showRegisterButton", publicName: "showRegisterButton", isSignal: true, isRequired: false, transformFunction: null }, showRememberMe: { classPropertyName: "showRememberMe", publicName: "showRememberMe", isSignal: true, isRequired: false, transformFunction: null }, enableDomainDiscovery: { classPropertyName: "enableDomainDiscovery", publicName: "enableDomainDiscovery", isSignal: true, isRequired: false, transformFunction: null }, showSocialLogin: { classPropertyName: "showSocialLogin", publicName: "showSocialLogin", isSignal: true, isRequired: false, transformFunction: null }, additionalSigninControls: { classPropertyName: "additionalSigninControls", publicName: "additionalSigninControls", isSignal: true, isRequired: false, transformFunction: null }, additionalSignupControls: { classPropertyName: "additionalSignupControls", publicName: "additionalSignupControls", isSignal: true, isRequired: false, transformFunction: null }, additionalSigninFields: { classPropertyName: "additionalSigninFields", publicName: "additionalSigninFields", isSignal: true, isRequired: false, transformFunction: null }, additionalSignupFields: { classPropertyName: "additionalSignupFields", publicName: "additionalSignupFields", isSignal: true, isRequired: false, transformFunction: null }, footerContent: { classPropertyName: "footerContent", publicName: "footerContent", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-card class=\"mat-elevation-z8 p-4 rounded\">\n <mat-card-header>\n <mat-card-title class=\"text-center\">{{ title() }}</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n @if (isLoginMode()) {\n <form [formGroup]=\"signinForm\" (ngSubmit)=\"signIn()\" class=\"d-flex flex-column gap-3\">\n <mat-form-field class=\"w-100\">\n <mat-label>Usuario</mat-label>\n <input matInput type=\"text\" placeholder=\"Ingrese su usuario\" formControlName=\"email\" />\n </mat-form-field>\n\n <!-- Show discovery message if OAuth is required -->\n @if (enableDomainDiscovery() && discoveryResult() && discoveryResult()!.requiresOAuth) {\n <div class=\"discovery-message\">\n @if (discoveryResult()!.provider) {\n <p>\n <mat-icon>info</mat-icon>\n Su organizaci\u00F3n utiliza {{ discoveryResult()!.provider }} para la autenticaci\u00F3n\n </p>\n @if (!discoveryResult()!.allowPasswordLogin) {\n <p class=\"warning\">Por favor, use el bot\u00F3n de inicio de sesi\u00F3n corporativo</p>\n }\n }\n </div>\n }\n\n <!-- Password field - only show if allowed -->\n @if (showPasswordLogin()) {\n <mat-form-field class=\"w-100\">\n <mat-label>Contrase\u00F1a</mat-label>\n <input\n matInput\n type=\"password\"\n placeholder=\"Ingrese su contrase\u00F1a\"\n formControlName=\"password\"\n autocomplete=\"current-password\"\n />\n </mat-form-field>\n\n <!-- Remember Me checkbox - conditional -->\n @if (showRememberMe()) {\n <div class=\"d-flex align-items-center mt-2\">\n <mat-checkbox formControlName=\"rememberMe\"> Recordarme </mat-checkbox>\n </div>\n }\n\n <!-- Additional signin fields -->\n <ng-container *ngTemplateOutlet=\"additionalSigninFields()\"></ng-container>\n\n <div class=\"d-flex justify-content-center mt-3\">\n <button\n mat-raised-button\n color=\"primary\"\n [disabled]=\"!signinForm.valid || isLoading()\"\n type=\"submit\"\n class=\"w-100\"\n >\n @if (isLoading()) {\n Ingresando...\n } @else {\n <ng-container>Ingresar <mat-icon>login</mat-icon></ng-container>\n }\n </button>\n </div>\n }\n\n <!-- OAuth/SSO Login Buttons -->\n @if (\n enableDomainDiscovery() &&\n discoveryResult() &&\n discoveryResult()!.requiresOAuth &&\n discoveryResult()!.provider\n ) {\n <div class=\"d-flex justify-content-center mt-3\">\n <button\n mat-raised-button\n color=\"accent\"\n type=\"button\"\n (click)=\"loginWithProvider()\"\n class=\"w-100 oauth-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon>business</mat-icon>\n Iniciar sesi\u00F3n con {{ discoveryResult()!.provider }}\n </button>\n </div>\n }\n\n <!-- Social Login Divider -->\n @if (showSocialLogin() && showPasswordLogin()) {\n <mat-divider class=\"my-3\"></mat-divider>\n <p class=\"text-center text-muted\">O continuar con</p>\n }\n\n <!-- Social Login Buttons -->\n @if (showSocialLogin() && !discoveryResult()?.requiresOAuth) {\n <div class=\"social-login-buttons\">\n <button\n mat-stroked-button\n type=\"button\"\n (click)=\"socialLogin('google')\"\n class=\"w-100 social-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon svgIcon=\"google\"></mat-icon>\n Google\n </button>\n\n <button\n mat-stroked-button\n type=\"button\"\n (click)=\"socialLogin('microsoft')\"\n class=\"w-100 social-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\n Microsoft\n </button>\n\n <button\n mat-stroked-button\n type=\"button\"\n (click)=\"socialLogin('github')\"\n class=\"w-100 social-button\"\n [disabled]=\"isLoading()\"\n >\n <mat-icon svgIcon=\"github\"></mat-icon>\n GitHub\n </button>\n </div>\n }\n\n <div class=\"text-center mt-2\">\n @if (showRegisterButton()) {\n <button mat-button type=\"button\" (click)=\"switchMode()\">\n \u00BFNo tienes cuenta? Reg\u00EDstrate\n </button>\n }\n </div>\n </form>\n } @else {\n <form [formGroup]=\"signupForm\" (ngSubmit)=\"registerUser()\" class=\"d-flex flex-column gap-3\">\n <mat-form-field class=\"w-100\">\n <mat-label>Nombre</mat-label>\n <input\n matInput\n type=\"text\"\n placeholder=\"Ingrese su nombre\"\n formControlName=\"displayName\"\n />\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Email</mat-label>\n <input matInput type=\"email\" placeholder=\"Ingrese su email\" formControlName=\"email\" />\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Contrase\u00F1a</mat-label>\n <input\n matInput\n type=\"password\"\n placeholder=\"Ingrese su contrase\u00F1a\"\n formControlName=\"password\"\n autocomplete=\"new-password\"\n />\n </mat-form-field>\n\n <!-- Additional signup fields -->\n <ng-container *ngTemplateOutlet=\"additionalSignupFields()\"></ng-container>\n\n <div class=\"d-flex justify-content-center mt-3\">\n <button\n mat-raised-button\n color=\"primary\"\n [disabled]=\"!signupForm.valid || isLoading()\"\n type=\"submit\"\n class=\"w-100\"\n >\n @if (isLoading()) {\n Registrando...\n } @else {\n <ng-container>Registrarse <mat-icon>person_add</mat-icon></ng-container>\n }\n </button>\n </div>\n\n <div class=\"text-center mt-2\">\n <button mat-button type=\"button\" (click)=\"switchMode()\">\n \u00BFYa tienes cuenta? Inicia sesi\u00F3n\n </button>\n </div>\n </form>\n }\n @if (errorMessage()) {\n <div class=\"alert alert-danger mt-3\" role=\"alert\">{{ errorMessage() }}</div>\n }\n </mat-card-content>\n @if (hasFooterContent()) {\n <mat-card-footer>\n <ng-container *ngTemplateOutlet=\"footerContent()\"></ng-container>\n </mat-card-footer>\n }\n</mat-card>\n", styles: [":host{display:flex;justify-content:center;align-items:center;min-height:100vh;width:100%;padding:16px;box-sizing:border-box}:host mat-card{width:100%;max-width:400px;border-radius:12px;box-shadow:0 8px 32px #0000001a}:host mat-card-header{text-align:center;margin-bottom:20px}:host mat-card-title{font-size:24px;font-weight:600;color:var(--mat-sys-primary, #6750a4)}:host mat-form-field{width:100%}:host mat-button{border-radius:8px}:host .w-100{width:100%}:host .d-flex{display:flex}:host .flex-column{flex-direction:column}:host .gap-3{gap:12px}:host .justify-content-center{justify-content:center}:host .discovery-message{padding:12px;background-color:#e3f2fd;border-radius:8px;margin-bottom:16px}:host .discovery-message p{margin:4px 0;display:flex;align-items:center;gap:8px;font-size:14px;color:#1565c0}:host .discovery-message p mat-icon{font-size:18px;width:18px;height:18px}:host .discovery-message p.warning{color:#f57c00;font-weight:500}:host .oauth-button{background-color:var(--mat-sys-secondary-container, #e8def8);color:var(--mat-sys-on-secondary-container, #1d192b);font-weight:500}:host .oauth-button mat-icon{margin-right:8px}:host .oauth-button:hover:not([disabled]){background-color:var(--mat-sys-secondary, #625b71);color:var(--mat-sys-on-secondary, #ffffff)}:host .social-login-buttons{display:flex;flex-direction:column;gap:12px;margin-top:16px}:host .social-button{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px 24px;font-weight:500;border:1.5px solid var(--mat-sys-outline, #79747e);transition:all .2s ease}:host .social-button mat-icon{width:20px;height:20px;font-size:20px}:host .social-button:hover:not([disabled]){background-color:var(--mat-sys-surface-variant, #e7e0ec);border:1.5px solid var(--mat-sys-primary, #6750a4)}:host .social-button[disabled]{opacity:.5;cursor:not-allowed}:host .text-muted{color:var(--mat-sys-outline, #79747e);font-size:14px;margin:8px 0}:host mat-divider{margin:16px 0}:host .align-items-center{align-items:center}:host .mt-3{margin-top:12px}:host .mt-2{margin-top:8px}:host .text-center{text-align:center}:host .p-4{padding:16px}:host .rounded{border-radius:12px}:host .m-t-10{margin-top:10px}:host .alert-danger{background-color:var(--mat-sys-error-container, #ffdad6);color:var(--mat-sys-on-error-container, #410002);padding:12px;border-radius:4px;border:1px solid var(--mat-sys-error, #ba1a1a)}:host .row{display:flex;flex-wrap:wrap;margin:0 -15px}:host .col-xs-12,:host .col-sm-12,:host .col-md-12{flex:0 0 100%;max-width:100%;padding:0 15px}:host .social{display:flex;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, 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]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatCardFooter, selector: "mat-card-footer" }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1222
1222
|
}
|
|
1223
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0
|
|
1223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Login, decorators: [{
|
|
1224
1224
|
type: Component,
|
|
1225
1225
|
args: [{ selector: 'acp-login', imports: [
|
|
1226
1226
|
CommonModule,
|
|
@@ -1327,8 +1327,8 @@ class OAuthCallbackComponent {
|
|
|
1327
1327
|
goToLogin() {
|
|
1328
1328
|
this.router.navigate(['/auth/login']);
|
|
1329
1329
|
}
|
|
1330
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0
|
|
1331
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0
|
|
1330
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: OAuthCallbackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1331
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: OAuthCallbackComponent, isStandalone: true, selector: "acp-oauth-callback", ngImport: i0, template: `
|
|
1332
1332
|
<div class="oauth-callback-container">
|
|
1333
1333
|
@if (loading) {
|
|
1334
1334
|
<mat-spinner diameter="48"></mat-spinner>
|
|
@@ -1345,7 +1345,7 @@ class OAuthCallbackComponent {
|
|
|
1345
1345
|
</div>
|
|
1346
1346
|
`, isInline: true, styles: [".oauth-callback-container{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:2rem;text-align:center}mat-spinner{margin-bottom:1.5rem}p{font-size:1rem;color:#666;margin:0}.error-message{max-width:400px}.error-message h2{color:#d32f2f;margin-bottom:1rem}.error-message p{color:#666;margin-bottom:2rem}.error-message button{padding:.75rem 2rem;background-color:#1976d2;color:#fff;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:background-color .2s}.error-message button:hover{background-color:#1565c0}\n"], dependencies: [{ kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1347
1347
|
}
|
|
1348
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0
|
|
1348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: OAuthCallbackComponent, decorators: [{
|
|
1349
1349
|
type: Component,
|
|
1350
1350
|
args: [{ selector: 'acp-oauth-callback', standalone: true, imports: [MatProgressSpinnerModule], template: `
|
|
1351
1351
|
<div class="oauth-callback-container">
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acontplus/ng-auth",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Comprehensive Angular authentication module with JWT token management, route guards, CSRF protection, URL redirection, session handling, and clean architecture patterns. Includes login components, auth interceptors, and DDD-based repositories.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@acontplus/core": "^1.1.4",
|
|
7
|
-
"@acontplus/ng-infrastructure": "
|
|
8
|
-
"@acontplus/ng-config": "
|
|
7
|
+
"@acontplus/ng-infrastructure": "2.2.1",
|
|
8
|
+
"@acontplus/ng-config": "2.0.6",
|
|
9
9
|
"@acontplus/ui-kit": "^1.0.2",
|
|
10
|
-
"@angular/common": "^22.
|
|
11
|
-
"@angular/core": "^22.
|
|
12
|
-
"@angular/router": "^22.
|
|
13
|
-
"@angular/forms": "^22.
|
|
14
|
-
"@angular/platform-browser": "^22.
|
|
15
|
-
"@angular/material": "^22.
|
|
10
|
+
"@angular/common": "^22.1.0",
|
|
11
|
+
"@angular/core": "^22.1.0",
|
|
12
|
+
"@angular/router": "^22.1.0",
|
|
13
|
+
"@angular/forms": "^22.1.0",
|
|
14
|
+
"@angular/platform-browser": "^22.1.0",
|
|
15
|
+
"@angular/material": "^22.1.0",
|
|
16
16
|
"jwt-decode": "^4.0.0",
|
|
17
17
|
"rxjs": "^7.8.1"
|
|
18
18
|
},
|