@rolatech/angular-auth 19.1.0-beta.3 → 20.0.0-beta.10
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/rolatech-angular-auth.mjs +21 -22
- package/fesm2022/rolatech-angular-auth.mjs.map +1 -1
- package/index.d.ts +16 -6
- package/package.json +7 -4
- package/lib/auth.routes.d.ts +0 -2
- package/lib/auth.store.d.ts +0 -16
- package/lib/components/address/address.component.d.ts +0 -13
- package/lib/components/auth-dialog/auth-dialog.component.d.ts +0 -7
- package/lib/components/faceid-detect-dialog/faceid-detect-dialog.component.d.ts +0 -25
- package/lib/components/forbidden/forbidden.component.d.ts +0 -5
- package/lib/components/index.d.ts +0 -2
- package/lib/components/unauthorized/unauthorized.component.d.ts +0 -5
- package/lib/guards/auth-dialog.guard.d.ts +0 -2
- package/lib/guards/auth.guard.d.ts +0 -2
- package/lib/guards/index.d.ts +0 -4
- package/lib/guards/permission.guard.d.ts +0 -2
- package/lib/guards/role.guard.d.ts +0 -2
- package/lib/interceptors/auth.interceptor.d.ts +0 -15
- package/lib/interceptors/error.interceptor.d.ts +0 -23
- package/lib/interceptors/index.d.ts +0 -2
- package/lib/interfaces/auth.interface.d.ts +0 -54
- package/lib/services/auth-agent.service.d.ts +0 -17
- package/lib/services/auth-user.service.d.ts +0 -40
- package/lib/services/auth.service.d.ts +0 -34
- package/lib/services/auth.user.service.d.ts +0 -41
- package/lib/services/index.d.ts +0 -4
- package/lib/services/storage.service.d.ts +0 -15
- package/provider.d.ts +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, signal, computed, Injectable, inject, output, model, PLATFORM_ID,
|
|
2
|
+
import { Component, signal, computed, Injectable, inject, output, model, PLATFORM_ID, InjectionToken, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
4
4
|
import { APP_CONFIG, AngularCommonModule } from '@rolatech/angular-common';
|
|
5
5
|
import { SnackBarService } from '@rolatech/angular-services';
|
|
@@ -320,18 +320,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
|
|
|
320
320
|
}] });
|
|
321
321
|
|
|
322
322
|
const AuthGuard = (route, state) => {
|
|
323
|
-
const environment = inject(APP_CONFIG);
|
|
324
|
-
const platformId = inject(PLATFORM_ID);
|
|
325
|
-
const lang = inject(LOCALE_ID);
|
|
326
323
|
const authService = inject(AuthService);
|
|
327
324
|
const router = inject(Router);
|
|
325
|
+
const environment = inject(APP_CONFIG);
|
|
326
|
+
const platformId = inject(PLATFORM_ID);
|
|
328
327
|
const isContinue = state.url.includes('continue');
|
|
329
328
|
const continueUrl = route.queryParams['continue'];
|
|
329
|
+
// window = inject(WINDOW)
|
|
330
330
|
if (!isPlatformBrowser(platformId)) {
|
|
331
331
|
return of(false);
|
|
332
332
|
}
|
|
333
333
|
return authService.introspect().pipe(map$1(({ roles, authenticated }) => {
|
|
334
|
-
console.log(lang);
|
|
335
334
|
const routeRoles = route.data['roles'];
|
|
336
335
|
const passRoled = routeRoles ? roles?.some((r) => routeRoles.indexOf(r) >= 0) : true;
|
|
337
336
|
if (authenticated && !passRoled) {
|
|
@@ -349,13 +348,11 @@ const AuthGuard = (route, state) => {
|
|
|
349
348
|
}
|
|
350
349
|
else {
|
|
351
350
|
if (!isContinue) {
|
|
352
|
-
|
|
353
|
-
window.location.href = environment.accountsUrl + `/signin?continue=${environment.myaccountUrl}`;
|
|
354
|
-
// window.location.href = environment.accountsUrl + `/signin?continue=${window.location.href}`;
|
|
355
|
-
// window.location.href = environment.accountsUrl + `/${lang}/signin?continue=${window.location.href}`;
|
|
351
|
+
window.location.href = environment.accountsUrl + `/signin?continue=${window.location.href}`;
|
|
356
352
|
}
|
|
353
|
+
return true;
|
|
357
354
|
}
|
|
358
|
-
return
|
|
355
|
+
return authenticated;
|
|
359
356
|
}));
|
|
360
357
|
};
|
|
361
358
|
|
|
@@ -785,19 +782,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
|
|
|
785
782
|
type: Injectable
|
|
786
783
|
}], ctorParameters: () => [] });
|
|
787
784
|
|
|
788
|
-
|
|
785
|
+
var AuthMethod;
|
|
786
|
+
(function (AuthMethod) {
|
|
787
|
+
AuthMethod["Password"] = "PASSWORD";
|
|
788
|
+
AuthMethod["OTP"] = "OTP";
|
|
789
|
+
AuthMethod["Google"] = "GOOGLE";
|
|
790
|
+
AuthMethod["WeChat"] = "WECHAT";
|
|
791
|
+
})(AuthMethod || (AuthMethod = {}));
|
|
792
|
+
const AUTH_METHODS = new InjectionToken('AUTH_METHODS');
|
|
793
|
+
function provideAngularAuth(config) {
|
|
789
794
|
const providers = [
|
|
790
795
|
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
// path: 'forbidden',
|
|
796
|
-
// component: ForbiddenComponent,
|
|
797
|
-
// },
|
|
798
|
-
// ],
|
|
799
|
-
// multi: true,
|
|
800
|
-
// },
|
|
796
|
+
{
|
|
797
|
+
provide: AUTH_METHODS,
|
|
798
|
+
useValue: config?.methods,
|
|
799
|
+
},
|
|
801
800
|
{
|
|
802
801
|
provide: HTTP_INTERCEPTORS,
|
|
803
802
|
useClass: AuthInterceptor,
|
|
@@ -822,5 +821,5 @@ const authRoutes = [
|
|
|
822
821
|
* Generated bundle index. Do not edit.
|
|
823
822
|
*/
|
|
824
823
|
|
|
825
|
-
export { AddressComponent, AddressType, AuthAgentService, AuthDialogGuard, AuthGuard, AuthInterceptor, AuthService, AuthStore, AuthUserService, ErrorInterceptor, FaceidDetectDialogComponent, ForbiddenComponent, LocalStorageService, PermissionGuard, RoleGuard, UnauthorizedComponent, UserStatus, authRoutes, provideAngularAuth };
|
|
824
|
+
export { AUTH_METHODS, AddressComponent, AddressType, AuthAgentService, AuthDialogGuard, AuthGuard, AuthInterceptor, AuthMethod, AuthService, AuthStore, AuthUserService, ErrorInterceptor, FaceidDetectDialogComponent, ForbiddenComponent, LocalStorageService, PermissionGuard, RoleGuard, UnauthorizedComponent, UserStatus, authRoutes, provideAngularAuth };
|
|
826
825
|
//# sourceMappingURL=rolatech-angular-auth.mjs.map
|