valtech-components 2.0.718 → 2.0.719
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/esm2022/lib/services/auth/auth.service.mjs +34 -4
- package/esm2022/lib/services/i18n/default-content.mjs +7 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +229 -194
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/services/auth/auth.service.d.ts +24 -2
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { SigninRequest, SigninResponse, SignupRequest, SignupResponse, VerifyEma
|
|
|
10
10
|
import { OAuthService } from './oauth.service';
|
|
11
11
|
import { FirebaseService, MessagingService } from '../firebase';
|
|
12
12
|
import { I18nService } from '../i18n';
|
|
13
|
+
import { ConfirmationDialogService } from '../confirmation-dialog/confirmation-dialog.service';
|
|
13
14
|
import * as i0 from "@angular/core";
|
|
14
15
|
/**
|
|
15
16
|
* Servicio principal de autenticación.
|
|
@@ -45,9 +46,10 @@ export declare class AuthService implements OnDestroy {
|
|
|
45
46
|
private oauthService;
|
|
46
47
|
private messagingService;
|
|
47
48
|
private i18nService;
|
|
49
|
+
private confirmationService;
|
|
48
50
|
private refreshTimerId;
|
|
49
51
|
private syncSubscription;
|
|
50
|
-
constructor(config: ValtechAuthConfig, http: HttpClient, router: Router, stateService: AuthStateService, tokenService: TokenService, storageService: AuthStorageService, syncService: AuthSyncService, firebaseService: FirebaseService, oauthService: OAuthService, messagingService: MessagingService | null, i18nService: I18nService | null);
|
|
52
|
+
constructor(config: ValtechAuthConfig, http: HttpClient, router: Router, stateService: AuthStateService, tokenService: TokenService, storageService: AuthStorageService, syncService: AuthSyncService, firebaseService: FirebaseService, oauthService: OAuthService, messagingService: MessagingService | null, i18nService: I18nService | null, confirmationService: ConfirmationDialogService);
|
|
51
53
|
/** Estado completo de autenticación */
|
|
52
54
|
readonly state: import("@angular/core").Signal<import("./types").AuthState>;
|
|
53
55
|
/** Usuario está autenticado */
|
|
@@ -178,6 +180,26 @@ export declare class AuthService implements OnDestroy {
|
|
|
178
180
|
roles?: string[];
|
|
179
181
|
permissions?: string[];
|
|
180
182
|
}): void;
|
|
183
|
+
/**
|
|
184
|
+
* Cierra sesión tras pedir confirmación al usuario.
|
|
185
|
+
*
|
|
186
|
+
* Muestra un diálogo nativo (estilo destructivo). Si el usuario confirma,
|
|
187
|
+
* ejecuta `logout()`. Si cancela, no pasa nada.
|
|
188
|
+
*
|
|
189
|
+
* Texto por defecto desde `_global` i18n: `logoutConfirmTitle`,
|
|
190
|
+
* `logoutConfirmMessage`, `logout`, `cancel`. Override via `opts`.
|
|
191
|
+
*
|
|
192
|
+
* @returns true si el usuario confirmó (logout ejecutado), false si canceló.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* onLogoutClick() { this.auth.logoutWithConfirmation(); }
|
|
196
|
+
*/
|
|
197
|
+
logoutWithConfirmation(opts?: {
|
|
198
|
+
title?: string;
|
|
199
|
+
message?: string;
|
|
200
|
+
confirmText?: string;
|
|
201
|
+
cancelText?: string;
|
|
202
|
+
}): Promise<boolean>;
|
|
181
203
|
/**
|
|
182
204
|
* Cierra sesión.
|
|
183
205
|
*/
|
|
@@ -396,6 +418,6 @@ export declare class AuthService implements OnDestroy {
|
|
|
396
418
|
* Detecta información de la plataforma del dispositivo.
|
|
397
419
|
*/
|
|
398
420
|
private detectPlatformInfo;
|
|
399
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
421
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, null]>;
|
|
400
422
|
static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
|
|
401
423
|
}
|
package/lib/version.d.ts
CHANGED