ngx-vector-components 4.52.0 → 4.54.0
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/CHANGELOG.md +900 -888
- package/README.md +35 -35
- package/assets/icons/chevron_down_icon.svg +3 -3
- package/assets/icons/home_menu_icon.svg +3 -3
- package/assets/icons/logout_icon.svg +9 -9
- package/assets/icons/menu_footer_icon.svg +3 -3
- package/assets/icons/menu_hamburguer_icon.svg +3 -3
- package/assets/icons/terms_of_use_icon.svg +9 -9
- package/assets/icons/vector_admin_icon.svg +4 -4
- package/assets/icons/vector_fintech_icon.svg +3 -3
- package/assets/icons/vector_logtech_icon.svg +6 -6
- package/assets/icons/vector_marketplace_icon.svg +3 -3
- package/assets/images/bunge_logo.svg +23 -23
- package/assets/images/cofco_logo.svg +117 -117
- package/assets/images/emote_bad.svg +6 -6
- package/assets/images/emote_cool.svg +5 -5
- package/assets/images/emote_nice.svg +5 -5
- package/assets/images/success_sign.svg +4 -4
- package/assets/images/vector-logo-horizontal-inverse-color.svg +13 -13
- package/assets/images/vector_logo_horizontal.svg +13 -13
- package/assets/images/warn_sign.svg +4 -4
- package/assets/styles/_fonts.scss +114 -114
- package/assets/styles/_mixins.scss +7 -7
- package/assets/styles/_primeng-custom-theme.scss +978 -978
- package/assets/styles/_spinner.scss +35 -35
- package/assets/styles/_styles.scss +115 -115
- package/assets/styles/_variables.scss +27 -27
- package/esm2020/lib/components/badge/badge.component.mjs +39 -39
- package/esm2020/lib/components/badge/badge.module.mjs +19 -19
- package/esm2020/lib/components/badge/index.mjs +3 -3
- package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +65 -65
- package/esm2020/lib/components/breadcrumb/breadcrumb.module.mjs +18 -18
- package/esm2020/lib/components/breadcrumb/index.mjs +3 -3
- package/esm2020/lib/components/crud-base/crud-base.component.mjs +47 -47
- package/esm2020/lib/components/crud-base/index.mjs +2 -2
- package/esm2020/lib/components/crud-footer/crud-footer.component.mjs +31 -31
- package/esm2020/lib/components/crud-footer/crud-footer.module.mjs +19 -19
- package/esm2020/lib/components/crud-footer/index.mjs +3 -3
- package/esm2020/lib/components/crud-header/crud-header.component.mjs +30 -30
- package/esm2020/lib/components/crud-header/crud-header.module.mjs +19 -19
- package/esm2020/lib/components/crud-header/index.mjs +3 -3
- package/esm2020/lib/components/crud-history/crud-history.component.mjs +82 -82
- package/esm2020/lib/components/crud-history/crud-history.module.mjs +20 -20
- package/esm2020/lib/components/crud-history/index.mjs +3 -3
- package/esm2020/lib/components/fields/button/button.component.mjs +41 -41
- package/esm2020/lib/components/fields/button/index.mjs +2 -2
- package/esm2020/lib/components/fields/calendar-field/calendar-field.component.mjs +74 -74
- package/esm2020/lib/components/fields/calendar-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/checkbox-field/checkbox-field.component.mjs +46 -46
- package/esm2020/lib/components/fields/checkbox-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/currency-field/currency-field.component.mjs +87 -87
- package/esm2020/lib/components/fields/currency-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/data-table/data-table.component.mjs +365 -365
- package/esm2020/lib/components/fields/data-table/index.mjs +2 -2
- package/esm2020/lib/components/fields/dropdown-field/dropdown-field.component.mjs +196 -196
- package/esm2020/lib/components/fields/dropdown-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/field-error-message/field-error-message.component.mjs +30 -30
- package/esm2020/lib/components/fields/field-error-message/index.mjs +2 -2
- package/esm2020/lib/components/fields/fields.module.mjs +205 -205
- package/esm2020/lib/components/fields/filters/filters.component.mjs +195 -195
- package/esm2020/lib/components/fields/filters/index.mjs +2 -2
- package/esm2020/lib/components/fields/index.mjs +19 -19
- package/esm2020/lib/components/fields/input-number-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/input-number-field/input-number-field.component.mjs +82 -82
- package/esm2020/lib/components/fields/multiselect-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/multiselect-field/multiselect-field.component.mjs +47 -47
- package/esm2020/lib/components/fields/percentage-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/percentage-field/percentage-field.component.mjs +42 -42
- package/esm2020/lib/components/fields/radio-button-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/radio-button-field/radio-button-field.component.mjs +38 -38
- package/esm2020/lib/components/fields/range-value/index.mjs +2 -2
- package/esm2020/lib/components/fields/range-value/range-value.component.mjs +72 -72
- package/esm2020/lib/components/fields/search-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/search-field/search-field.component.mjs +33 -33
- package/esm2020/lib/components/fields/select-button-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/select-button-field/select-button-field.component.mjs +20 -20
- package/esm2020/lib/components/fields/text-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/text-field/text-field.component.mjs +209 -209
- package/esm2020/lib/components/fields/textarea-field/index.mjs +2 -2
- package/esm2020/lib/components/fields/textarea-field/textarea-field.component.mjs +75 -75
- package/esm2020/lib/components/generic-error-modal/generic-error-modal.component.mjs +30 -30
- package/esm2020/lib/components/generic-error-modal/generic-error-modal.module.mjs +20 -20
- package/esm2020/lib/components/generic-error-modal/index.mjs +3 -3
- package/esm2020/lib/components/generic-modal/generic-modal.component.mjs +66 -66
- package/esm2020/lib/components/generic-modal/generic-modal.module.mjs +20 -20
- package/esm2020/lib/components/generic-modal/index.mjs +3 -3
- package/esm2020/lib/components/index.mjs +13 -13
- package/esm2020/lib/components/menu/index.mjs +4 -4
- package/esm2020/lib/components/menu/menu.component.mjs +302 -302
- package/esm2020/lib/components/menu/menu.module.mjs +20 -20
- package/esm2020/lib/components/menu/sub-menus-list/sub-menus-list.component.mjs +42 -42
- package/esm2020/lib/components/panel/index.mjs +3 -3
- package/esm2020/lib/components/panel/panel.component.mjs +15 -15
- package/esm2020/lib/components/panel/panel.module.mjs +19 -19
- package/esm2020/lib/components/top-bar/index.mjs +3 -3
- package/esm2020/lib/components/top-bar/top-bar.component.mjs +102 -102
- package/esm2020/lib/components/top-bar/top-bar.module.mjs +19 -19
- package/esm2020/lib/guards/crud-list-has-items.guard.mjs +22 -22
- package/esm2020/lib/guards/get-token-by-guid.guard.mjs +54 -54
- package/esm2020/lib/guards/has-permission.guard.mjs +27 -27
- package/esm2020/lib/guards/index.mjs +6 -6
- package/esm2020/lib/guards/role.guard.mjs +24 -24
- package/esm2020/lib/guards/token-is-present.guard.mjs +26 -26
- package/esm2020/lib/interceptors/http-interceptor.mjs +183 -183
- package/esm2020/lib/interceptors/index.mjs +2 -2
- package/esm2020/lib/models/app-name.enum.mjs +9 -9
- package/esm2020/lib/models/boolean-type.enum.mjs +6 -6
- package/esm2020/lib/models/crud-history.model.mjs +3 -3
- package/esm2020/lib/models/crud-mode.enum.mjs +7 -7
- package/esm2020/lib/models/data-table.model.mjs +22 -22
- package/esm2020/lib/models/document-type.enum.mjs +6 -6
- package/esm2020/lib/models/filters.model.mjs +2 -2
- package/esm2020/lib/models/generic-modal.model.mjs +2 -2
- package/esm2020/lib/models/http-response.model.mjs +2 -2
- package/esm2020/lib/models/index.mjs +16 -16
- package/esm2020/lib/models/ip-info.enum.mjs +2 -2
- package/esm2020/lib/models/list-item.model.mjs +2 -2
- package/esm2020/lib/models/menu-item.model.mjs +2 -2
- package/esm2020/lib/models/message-status.enum.mjs +8 -8
- package/esm2020/lib/models/profile.model.mjs +217 -212
- package/esm2020/lib/models/role.enum.mjs +5 -5
- package/esm2020/lib/models/status.enum.mjs +8 -8
- package/esm2020/lib/models/view.enum.mjs +7 -7
- package/esm2020/lib/pipes/currency-brl.pipe.mjs +18 -18
- package/esm2020/lib/pipes/format-document.pipe.mjs +17 -17
- package/esm2020/lib/pipes/index.mjs +8 -8
- package/esm2020/lib/pipes/mask.pipe.mjs +21 -21
- package/esm2020/lib/pipes/not-hidden.pipe.mjs +16 -16
- package/esm2020/lib/pipes/only-active.pipe.mjs +16 -16
- package/esm2020/lib/pipes/pipes.module.mjs +21 -21
- package/esm2020/lib/pipes/remove-last-child.pipe.mjs +18 -18
- package/esm2020/lib/resolvers/get-selected-crud-item.resolver.mjs +28 -28
- package/esm2020/lib/resolvers/index.mjs +2 -2
- package/esm2020/lib/services/auth.service.mjs +77 -77
- package/esm2020/lib/services/base-dropdown.mjs +2 -2
- package/esm2020/lib/services/crud-base.service.mjs +14 -14
- package/esm2020/lib/services/enum.service.mjs +43 -43
- package/esm2020/lib/services/error-message.service.mjs +16 -16
- package/esm2020/lib/services/geolocation.service.mjs +23 -23
- package/esm2020/lib/services/index.mjs +12 -12
- package/esm2020/lib/services/loading.service.mjs +15 -15
- package/esm2020/lib/services/menu.service.mjs +147 -147
- package/esm2020/lib/services/modal.service.mjs +15 -15
- package/esm2020/lib/services/profile.service.mjs +100 -100
- package/esm2020/lib/services/storage.service.mjs +108 -108
- package/esm2020/lib/shared/shared.module.mjs +17 -17
- package/esm2020/lib/utils/cpf-cnpj-validator.util.mjs +116 -116
- package/esm2020/lib/utils/file.util.mjs +15 -15
- package/esm2020/lib/utils/index.mjs +8 -8
- package/esm2020/lib/utils/mask.util.mjs +66 -66
- package/esm2020/lib/utils/object.util.mjs +27 -27
- package/esm2020/lib/utils/string.util.mjs +16 -16
- package/esm2020/lib/utils/validation.util.mjs +234 -234
- package/esm2020/lib/utils/window.util.mjs +9 -9
- package/esm2020/ngx-vector-components.mjs +4 -4
- package/esm2020/public-api.mjs +9 -9
- package/fesm2015/ngx-vector-components.mjs +4217 -4212
- package/fesm2015/ngx-vector-components.mjs.map +1 -1
- package/fesm2020/ngx-vector-components.mjs +4194 -4189
- package/fesm2020/ngx-vector-components.mjs.map +1 -1
- package/lib/components/badge/badge.component.d.ts +15 -15
- package/lib/components/badge/badge.module.d.ts +9 -9
- package/lib/components/badge/index.d.ts +2 -2
- package/lib/components/breadcrumb/breadcrumb.component.d.ts +19 -19
- package/lib/components/breadcrumb/breadcrumb.module.d.ts +8 -8
- package/lib/components/breadcrumb/index.d.ts +2 -2
- package/lib/components/crud-base/crud-base.component.d.ts +20 -20
- package/lib/components/crud-base/index.d.ts +1 -1
- package/lib/components/crud-footer/crud-footer.component.d.ts +13 -13
- package/lib/components/crud-footer/crud-footer.module.d.ts +9 -9
- package/lib/components/crud-footer/index.d.ts +2 -2
- package/lib/components/crud-header/crud-header.component.d.ts +11 -11
- package/lib/components/crud-header/crud-header.module.d.ts +9 -9
- package/lib/components/crud-header/index.d.ts +2 -2
- package/lib/components/crud-history/crud-history.component.d.ts +12 -12
- package/lib/components/crud-history/crud-history.module.d.ts +10 -10
- package/lib/components/crud-history/index.d.ts +2 -2
- package/lib/components/fields/button/button.component.d.ts +17 -17
- package/lib/components/fields/button/index.d.ts +1 -1
- package/lib/components/fields/calendar-field/calendar-field.component.d.ts +23 -23
- package/lib/components/fields/calendar-field/index.d.ts +1 -1
- package/lib/components/fields/checkbox-field/checkbox-field.component.d.ts +19 -19
- package/lib/components/fields/checkbox-field/index.d.ts +1 -1
- package/lib/components/fields/currency-field/currency-field.component.d.ts +27 -27
- package/lib/components/fields/currency-field/index.d.ts +1 -1
- package/lib/components/fields/data-table/data-table.component.d.ts +78 -78
- package/lib/components/fields/data-table/index.d.ts +1 -1
- package/lib/components/fields/dropdown-field/dropdown-field.component.d.ts +50 -50
- package/lib/components/fields/dropdown-field/index.d.ts +1 -1
- package/lib/components/fields/field-error-message/field-error-message.component.d.ts +10 -10
- package/lib/components/fields/field-error-message/index.d.ts +1 -1
- package/lib/components/fields/fields.module.d.ts +46 -46
- package/lib/components/fields/filters/filters.component.d.ts +61 -61
- package/lib/components/fields/filters/index.d.ts +1 -1
- package/lib/components/fields/index.d.ts +18 -18
- package/lib/components/fields/input-number-field/index.d.ts +1 -1
- package/lib/components/fields/input-number-field/input-number-field.component.d.ts +27 -27
- package/lib/components/fields/multiselect-field/index.d.ts +1 -1
- package/lib/components/fields/multiselect-field/multiselect-field.component.d.ts +15 -15
- package/lib/components/fields/percentage-field/index.d.ts +1 -1
- package/lib/components/fields/percentage-field/percentage-field.component.d.ts +16 -16
- package/lib/components/fields/radio-button-field/index.d.ts +1 -1
- package/lib/components/fields/radio-button-field/radio-button-field.component.d.ts +21 -21
- package/lib/components/fields/range-value/index.d.ts +1 -1
- package/lib/components/fields/range-value/range-value.component.d.ts +18 -18
- package/lib/components/fields/search-field/index.d.ts +1 -1
- package/lib/components/fields/search-field/search-field.component.d.ts +14 -14
- package/lib/components/fields/select-button-field/index.d.ts +1 -1
- package/lib/components/fields/select-button-field/select-button-field.component.d.ts +9 -9
- package/lib/components/fields/text-field/index.d.ts +1 -1
- package/lib/components/fields/text-field/text-field.component.d.ts +48 -48
- package/lib/components/fields/textarea-field/index.d.ts +1 -1
- package/lib/components/fields/textarea-field/textarea-field.component.d.ts +20 -20
- package/lib/components/generic-error-modal/generic-error-modal.component.d.ts +14 -14
- package/lib/components/generic-error-modal/generic-error-modal.module.d.ts +10 -10
- package/lib/components/generic-error-modal/index.d.ts +2 -2
- package/lib/components/generic-modal/generic-modal.component.d.ts +24 -24
- package/lib/components/generic-modal/generic-modal.module.d.ts +10 -10
- package/lib/components/generic-modal/index.d.ts +2 -2
- package/lib/components/index.d.ts +12 -12
- package/lib/components/menu/index.d.ts +3 -3
- package/lib/components/menu/menu.component.d.ts +54 -54
- package/lib/components/menu/menu.module.d.ts +10 -10
- package/lib/components/menu/sub-menus-list/sub-menus-list.component.d.ts +14 -14
- package/lib/components/panel/index.d.ts +2 -2
- package/lib/components/panel/panel.component.d.ts +8 -8
- package/lib/components/panel/panel.module.d.ts +9 -9
- package/lib/components/top-bar/index.d.ts +2 -2
- package/lib/components/top-bar/top-bar.component.d.ts +38 -38
- package/lib/components/top-bar/top-bar.module.d.ts +9 -9
- package/lib/guards/crud-list-has-items.guard.d.ts +10 -10
- package/lib/guards/get-token-by-guid.guard.d.ts +15 -15
- package/lib/guards/has-permission.guard.d.ts +13 -13
- package/lib/guards/index.d.ts +5 -5
- package/lib/guards/role.guard.d.ts +11 -11
- package/lib/guards/token-is-present.guard.d.ts +11 -11
- package/lib/interceptors/http-interceptor.d.ts +31 -31
- package/lib/interceptors/index.d.ts +1 -1
- package/lib/models/app-name.enum.d.ts +7 -7
- package/lib/models/boolean-type.enum.d.ts +4 -4
- package/lib/models/crud-history.model.d.ts +13 -13
- package/lib/models/crud-mode.enum.d.ts +5 -5
- package/lib/models/data-table.model.d.ts +62 -62
- package/lib/models/document-type.enum.d.ts +4 -4
- package/lib/models/filters.model.d.ts +4 -4
- package/lib/models/generic-modal.model.d.ts +13 -13
- package/lib/models/http-response.model.d.ts +40 -40
- package/lib/models/index.d.ts +15 -15
- package/lib/models/ip-info.enum.d.ts +6 -6
- package/lib/models/list-item.model.d.ts +6 -6
- package/lib/models/menu-item.model.d.ts +16 -16
- package/lib/models/message-status.enum.d.ts +6 -6
- package/lib/models/profile.model.d.ts +238 -233
- package/lib/models/role.enum.d.ts +3 -3
- package/lib/models/status.enum.d.ts +6 -6
- package/lib/models/view.enum.d.ts +5 -5
- package/lib/pipes/currency-brl.pipe.d.ts +7 -7
- package/lib/pipes/format-document.pipe.d.ts +7 -7
- package/lib/pipes/index.d.ts +7 -7
- package/lib/pipes/mask.pipe.d.ts +7 -7
- package/lib/pipes/not-hidden.pipe.d.ts +7 -7
- package/lib/pipes/only-active.pipe.d.ts +7 -7
- package/lib/pipes/pipes.module.d.ts +12 -12
- package/lib/pipes/remove-last-child.pipe.d.ts +7 -7
- package/lib/resolvers/get-selected-crud-item.resolver.d.ts +10 -10
- package/lib/resolvers/index.d.ts +1 -1
- package/lib/services/auth.service.d.ts +24 -24
- package/lib/services/base-dropdown.d.ts +7 -7
- package/lib/services/crud-base.service.d.ts +7 -7
- package/lib/services/enum.service.d.ts +13 -13
- package/lib/services/error-message.service.d.ts +8 -8
- package/lib/services/geolocation.service.d.ts +13 -13
- package/lib/services/index.d.ts +11 -11
- package/lib/services/loading.service.d.ts +7 -7
- package/lib/services/menu.service.d.ts +37 -37
- package/lib/services/modal.service.d.ts +7 -7
- package/lib/services/profile.service.d.ts +26 -26
- package/lib/services/storage.service.d.ts +43 -43
- package/lib/shared/shared.module.d.ts +9 -9
- package/lib/utils/cpf-cnpj-validator.util.d.ts +5 -5
- package/lib/utils/file.util.d.ts +4 -4
- package/lib/utils/index.d.ts +7 -7
- package/lib/utils/mask.util.d.ts +17 -17
- package/lib/utils/object.util.d.ts +5 -5
- package/lib/utils/string.util.d.ts +4 -4
- package/lib/utils/validation.util.d.ts +17 -17
- package/lib/utils/window.util.d.ts +4 -4
- package/ngx-vector-components.d.ts +5 -5
- package/package.json +1 -1
- package/public-api.d.ts +8 -8
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { Inject, Injectable } from '@angular/core';
|
|
2
|
-
import { map, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { Role } from '../models';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "../services";
|
|
6
|
-
import * as i2 from "@angular/router";
|
|
7
|
-
import * as i3 from "../models";
|
|
8
|
-
export class GetTokenByGuidGuard {
|
|
9
|
-
constructor(authService, storageService, router, profileService, appName) {
|
|
10
|
-
this.authService = authService;
|
|
11
|
-
this.storageService = storageService;
|
|
12
|
-
this.router = router;
|
|
13
|
-
this.profileService = profileService;
|
|
14
|
-
this.appName = appName;
|
|
15
|
-
}
|
|
16
|
-
canActivate(route) {
|
|
17
|
-
const paramTokenGuid = route.queryParams['Token'];
|
|
18
|
-
const role = atob(route.queryParams['role'] || '');
|
|
19
|
-
this.authService.role$.next(role);
|
|
20
|
-
if (paramTokenGuid) {
|
|
21
|
-
this.storageService.clear();
|
|
22
|
-
this.storageService.setRole(route.queryParams['role']);
|
|
23
|
-
this.storageService.setUserId(route.queryParams['userId']);
|
|
24
|
-
return this.authService.getTokenByGuid(paramTokenGuid).pipe(switchMap((token) => {
|
|
25
|
-
if (token && role !== Role.ADMIN) {
|
|
26
|
-
this.router.createUrlTree([this.appName.toLowerCase()]);
|
|
27
|
-
}
|
|
28
|
-
return this.profileService.getUserInfo().pipe(map((response) => {
|
|
29
|
-
if (response.id) {
|
|
30
|
-
this.storageService.setUserId(response.id);
|
|
31
|
-
}
|
|
32
|
-
return true;
|
|
33
|
-
}));
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
else if (this.storageService.getToken()) {
|
|
37
|
-
if (role !== Role.ADMIN) {
|
|
38
|
-
return this.router.createUrlTree([this.appName.toLowerCase()]);
|
|
39
|
-
}
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
this.authService.logout();
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
GetTokenByGuidGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard, deps: [{ token: i1.AuthService }, { token: i1.StorageService }, { token: i2.Router }, { token: i1.ProfileService }, { token: 'appName' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
47
|
-
GetTokenByGuidGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard });
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard, decorators: [{
|
|
49
|
-
type: Injectable
|
|
50
|
-
}], ctorParameters: function () { return [{ type: i1.AuthService }, { type: i1.StorageService }, { type: i2.Router }, { type: i1.ProfileService }, { type: i3.AppName, decorators: [{
|
|
51
|
-
type: Inject,
|
|
52
|
-
args: ['appName']
|
|
53
|
-
}] }]; } });
|
|
54
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Inject, Injectable } from '@angular/core';
|
|
2
|
+
import { map, switchMap } from 'rxjs/operators';
|
|
3
|
+
import { Role } from '../models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "../services";
|
|
6
|
+
import * as i2 from "@angular/router";
|
|
7
|
+
import * as i3 from "../models";
|
|
8
|
+
export class GetTokenByGuidGuard {
|
|
9
|
+
constructor(authService, storageService, router, profileService, appName) {
|
|
10
|
+
this.authService = authService;
|
|
11
|
+
this.storageService = storageService;
|
|
12
|
+
this.router = router;
|
|
13
|
+
this.profileService = profileService;
|
|
14
|
+
this.appName = appName;
|
|
15
|
+
}
|
|
16
|
+
canActivate(route) {
|
|
17
|
+
const paramTokenGuid = route.queryParams['Token'];
|
|
18
|
+
const role = atob(route.queryParams['role'] || '');
|
|
19
|
+
this.authService.role$.next(role);
|
|
20
|
+
if (paramTokenGuid) {
|
|
21
|
+
this.storageService.clear();
|
|
22
|
+
this.storageService.setRole(route.queryParams['role']);
|
|
23
|
+
this.storageService.setUserId(route.queryParams['userId']);
|
|
24
|
+
return this.authService.getTokenByGuid(paramTokenGuid).pipe(switchMap((token) => {
|
|
25
|
+
if (token && role !== Role.ADMIN) {
|
|
26
|
+
this.router.createUrlTree([this.appName.toLowerCase()]);
|
|
27
|
+
}
|
|
28
|
+
return this.profileService.getUserInfo().pipe(map((response) => {
|
|
29
|
+
if (response.id) {
|
|
30
|
+
this.storageService.setUserId(response.id);
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}));
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
else if (this.storageService.getToken()) {
|
|
37
|
+
if (role !== Role.ADMIN) {
|
|
38
|
+
return this.router.createUrlTree([this.appName.toLowerCase()]);
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
this.authService.logout();
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
GetTokenByGuidGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard, deps: [{ token: i1.AuthService }, { token: i1.StorageService }, { token: i2.Router }, { token: i1.ProfileService }, { token: 'appName' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
47
|
+
GetTokenByGuidGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard });
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GetTokenByGuidGuard, decorators: [{
|
|
49
|
+
type: Injectable
|
|
50
|
+
}], ctorParameters: function () { return [{ type: i1.AuthService }, { type: i1.StorageService }, { type: i2.Router }, { type: i1.ProfileService }, { type: i3.AppName, decorators: [{
|
|
51
|
+
type: Inject,
|
|
52
|
+
args: ['appName']
|
|
53
|
+
}] }]; } });
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXRva2VuLWJ5LWd1aWQuZ3VhcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdmVjdG9yLWNvbXBvbmVudHMvc3JjL2xpYi9ndWFyZHMvZ2V0LXRva2VuLWJ5LWd1aWQuZ3VhcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFbkQsT0FBTyxFQUFFLEdBQUcsRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUNoRCxPQUFPLEVBQVcsSUFBSSxFQUFFLE1BQU0sV0FBVyxDQUFDOzs7OztBQUkxQyxNQUFNLE9BQU8sbUJBQW1CO0lBQzlCLFlBQ1UsV0FBd0IsRUFDeEIsY0FBOEIsRUFDOUIsTUFBYyxFQUNkLGNBQThCLEVBQ1gsT0FBZ0I7UUFKbkMsZ0JBQVcsR0FBWCxXQUFXLENBQWE7UUFDeEIsbUJBQWMsR0FBZCxjQUFjLENBQWdCO1FBQzlCLFdBQU0sR0FBTixNQUFNLENBQVE7UUFDZCxtQkFBYyxHQUFkLGNBQWMsQ0FBZ0I7UUFDWCxZQUFPLE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ByZXR1cm4gdGhpcy5hdXRoU2VydmljZS5nZXRUb2tlbkJ5R3VpZChwYXJhbVRva2VuR3VpZCkucGlwZShcbiAgICAgICAgc3dpdGNoTWFwKCh0b2tlbikgPT4ge1xuICAgICAgICAgIGlmICh0b2tlbiAmJiByb2xlICE9PSBSb2xlLkFETUlOKSB7XG4gICAgICAgICAgICB0aGlzLnJvdXRlci5jcmVhdGVVcmxUcmVlKFt0aGlzLmFwcE5hbWUudG9Mb3dlckNhc2UoKV0pO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGhpcy5wcm9maWxlU2VydmljZS5nZXRVc2VySW5mbygpLnBpcGUoXG4gICAgICAgICAgICBtYXAoKHJlc3BvbnNlKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChyZXNwb25zZS5pZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc3RvcmFnZVNlcnZpY2Uuc2V0VXNlcklkKHJlc3BvbnNlLmlkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgKTtcbiAgICAgICAgfSlcbiAgICAgICk7XG4gICAgfSBlbHNlIGlmICh0aGlzLnN0b3JhZ2VTZXJ2aWNlLmdldFRva2VuKCkpIHtcbiAgICAgIGlmIChyb2xlICE9PSBSb2xlLkFETUlOKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnJvdXRlci5jcmVhdGVVcmxUcmVlKFt0aGlzLmFwcE5hbWUudG9Mb3dlckNhc2UoKV0pO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIHRoaXMuYXV0aFNlcnZpY2UubG9nb3V0KCk7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG4iXX0=
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Inject, Injectable } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "../services";
|
|
4
|
-
import * as i2 from "@angular/router";
|
|
5
|
-
import * as i3 from "../models";
|
|
6
|
-
export class HasPermissionGuard {
|
|
7
|
-
constructor(profileService, router, appName) {
|
|
8
|
-
this.profileService = profileService;
|
|
9
|
-
this.router = router;
|
|
10
|
-
this.appName = appName;
|
|
11
|
-
}
|
|
12
|
-
canActivate(routeSnapshot) {
|
|
13
|
-
if (!this.profileService.userHasPermission(routeSnapshot.data['permission'])) {
|
|
14
|
-
return this.router.createUrlTree([this.appName.toLowerCase()]);
|
|
15
|
-
}
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
HasPermissionGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: HasPermissionGuard, deps: [{ token: i1.ProfileService }, { token: i2.Router }, { token: 'appName' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
-
HasPermissionGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: HasPermissionGuard });
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: HasPermissionGuard, decorators: [{
|
|
22
|
-
type: Injectable
|
|
23
|
-
}], ctorParameters: function () { return [{ type: i1.ProfileService }, { type: i2.Router }, { type: i3.AppName, decorators: [{
|
|
24
|
-
type: Inject,
|
|
25
|
-
args: ['appName']
|
|
26
|
-
}] }]; } });
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Inject, Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "../services";
|
|
4
|
+
import * as i2 from "@angular/router";
|
|
5
|
+
import * as i3 from "../models";
|
|
6
|
+
export class HasPermissionGuard {
|
|
7
|
+
constructor(profileService, router, appName) {
|
|
8
|
+
this.profileService = profileService;
|
|
9
|
+
this.router = router;
|
|
10
|
+
this.appName = appName;
|
|
11
|
+
}
|
|
12
|
+
canActivate(routeSnapshot) {
|
|
13
|
+
if (!this.profileService.userHasPermission(routeSnapshot.data['permission'])) {
|
|
14
|
+
return this.router.createUrlTree([this.appName.toLowerCase()]);
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
HasPermissionGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: HasPermissionGuard, deps: [{ token: i1.ProfileService }, { token: i2.Router }, { token: 'appName' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
+
HasPermissionGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: HasPermissionGuard });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: HasPermissionGuard, decorators: [{
|
|
22
|
+
type: Injectable
|
|
23
|
+
}], ctorParameters: function () { return [{ type: i1.ProfileService }, { type: i2.Router }, { type: i3.AppName, decorators: [{
|
|
24
|
+
type: Inject,
|
|
25
|
+
args: ['appName']
|
|
26
|
+
}] }]; } });
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFzLXBlcm1pc3Npb24uZ3VhcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdmVjdG9yLWNvbXBvbmVudHMvc3JjL2xpYi9ndWFyZHMvaGFzLXBlcm1pc3Npb24uZ3VhcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7O0FBTW5ELE1BQU0sT0FBTyxrQkFBa0I7SUFDN0IsWUFDVSxjQUE4QixFQUM5QixNQUF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gcHJpdmF0ZSByb3V0ZXI6IFJvdXRlcixcbiAgICBASW5qZWN0KCdhcHBOYW1lJykgcHJpdmF0ZSBhcHBOYW1lOiBBcHBOYW1lXG4gICkge31cblxuICBjYW5BY3RpdmF0ZShyb3V0ZVNuYXBzaG90OiBBY3RpdmF0ZWRSb3V0ZVNuYXBzaG90KSB7XG4gICAgaWYgKCF0aGlzLnByb2ZpbGVTZXJ2aWNlLnVzZXJIYXNQZXJtaXNzaW9uKHJvdXRlU25hcHNob3QuZGF0YVsncGVybWlzc2lvbiddKSkge1xuICAgICAgcmV0dXJuIHRoaXMucm91dGVyLmNyZWF0ZVVybFRyZWUoW3RoaXMuYXBwTmFtZS50b0xvd2VyQ2FzZSgpXSk7XG4gICAgfVxuICAgIHJldHVybiB0cnVlO1xuICB9XG59XG4iXX0=
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './crud-list-has-items.guard';
|
|
2
|
-
export * from './get-token-by-guid.guard';
|
|
3
|
-
export * from './has-permission.guard';
|
|
4
|
-
export * from './role.guard';
|
|
5
|
-
export * from './token-is-present.guard';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export * from './crud-list-has-items.guard';
|
|
2
|
+
export * from './get-token-by-guid.guard';
|
|
3
|
+
export * from './has-permission.guard';
|
|
4
|
+
export * from './role.guard';
|
|
5
|
+
export * from './token-is-present.guard';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdmVjdG9yLWNvbXBvbmVudHMvc3JjL2xpYi9ndWFyZHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYywwQkFBMEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vY3J1ZC1saXN0LWhhcy1pdGVtcy5ndWFyZCc7XG5leHBvcnQgKiBmcm9tICcuL2dldC10b2tlbi1ieS1ndWlkLmd1YXJkJztcbmV4cG9ydCAqIGZyb20gJy4vaGFzLXBlcm1pc3Npb24uZ3VhcmQnO1xuZXhwb3J0ICogZnJvbSAnLi9yb2xlLmd1YXJkJztcbmV4cG9ydCAqIGZyb20gJy4vdG9rZW4taXMtcHJlc2VudC5ndWFyZCc7XG4iXX0=
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Role } from '../models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "../services";
|
|
5
|
-
import * as i2 from "@angular/router";
|
|
6
|
-
export class RoleGuard {
|
|
7
|
-
constructor(storageService, router) {
|
|
8
|
-
this.storageService = storageService;
|
|
9
|
-
this.router = router;
|
|
10
|
-
}
|
|
11
|
-
canActivate(routeSnapshot) {
|
|
12
|
-
const isRoleAdmin = this.storageService.getRole() === Role.ADMIN;
|
|
13
|
-
if ((routeSnapshot.data['adminView'] && isRoleAdmin) || (!routeSnapshot.data['adminView'] && !isRoleAdmin)) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
return this.router.createUrlTree(['']);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
RoleGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: RoleGuard, deps: [{ token: i1.StorageService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
-
RoleGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: RoleGuard });
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: RoleGuard, decorators: [{
|
|
22
|
-
type: Injectable
|
|
23
|
-
}], ctorParameters: function () { return [{ type: i1.StorageService }, { type: i2.Router }]; } });
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { Role } from '../models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../services";
|
|
5
|
+
import * as i2 from "@angular/router";
|
|
6
|
+
export class RoleGuard {
|
|
7
|
+
constructor(storageService, router) {
|
|
8
|
+
this.storageService = storageService;
|
|
9
|
+
this.router = router;
|
|
10
|
+
}
|
|
11
|
+
canActivate(routeSnapshot) {
|
|
12
|
+
const isRoleAdmin = this.storageService.getRole() === Role.ADMIN;
|
|
13
|
+
if ((routeSnapshot.data['adminView'] && isRoleAdmin) || (!routeSnapshot.data['adminView'] && !isRoleAdmin)) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return this.router.createUrlTree(['']);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
RoleGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: RoleGuard, deps: [{ token: i1.StorageService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
+
RoleGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: RoleGuard });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: RoleGuard, decorators: [{
|
|
22
|
+
type: Injectable
|
|
23
|
+
}], ctorParameters: function () { return [{ type: i1.StorageService }, { type: i2.Router }]; } });
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm9sZS5ndWFyZC5qcyIsInNv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2YXRlLCBSb3V0ZXIgfSBmcm9tICdAYW5ndWxhci9yb3V0ZXInO1xuaW1wb3J0IHsgUm9sZSB9IGZyb20gJy4uL21vZGVscyc7XG5pbXBvcnQgeyBTdG9yYWdlU2VydmljZSB9IGZyb20gJy4uL3NlcnZpY2VzJztcblxuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIFJvbGVHdWFyZCBpbXBsZW1lbnRzIENhbkFjdGl2YXRlIHtcbiAgY29uc3RydWN0b3IocHJpdmF0ZSBzdG9yYWdlU2VydmljZTogU3RvcmFnZVNlcnZpY2UsIHByaXZhdGUgcm91dGVyOiBSb3V0ZXIpIHt9XG5cbiAgY2FuQWN0aXZhdGUocm91dGVTbmFwc2hvdDogQWN0aXZhdGVkUm91dGVTbmFwc2hvdCkge1xuICAgIGNvbnN0IGlzUm9sZUFkbWluID0gdGhpcy5zdG9yYWdlU2VydmljZS5nZXRSb2xlKCkgPT09IFJvbGUuQURNSU47XG4gICAgaWYgKChyb3V0ZVNuYXBzaG90LmRhdGFbJ2FkbWluVmlldyddICYmIGlzUm9sZUFkbWluKSB8fCAoIXJvdXRlU25hcHNob3QuZGF0YVsnYWRtaW5WaWV3J10gJiYgIWlzUm9sZUFkbWluKSkge1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIHJldHVybiB0aGlzLnJvdXRlci5jcmVhdGVVcmxUcmVlKFsnJ10pO1xuICB9XG59XG4iXX0=
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "../services";
|
|
4
|
-
export class TokenIsPresentGuard {
|
|
5
|
-
constructor(storageService, authService) {
|
|
6
|
-
this.storageService = storageService;
|
|
7
|
-
this.authService = authService;
|
|
8
|
-
}
|
|
9
|
-
canActivate(routeSnapshot) {
|
|
10
|
-
if (routeSnapshot.queryParams['tokenGuid']) {
|
|
11
|
-
return this.authService
|
|
12
|
-
.getTokenByGuid(routeSnapshot.queryParams['tokenGuid'])
|
|
13
|
-
.toPromise()
|
|
14
|
-
.then((response) => !!response.accessToken);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return !!this.storageService.getToken();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
TokenIsPresentGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TokenIsPresentGuard, deps: [{ token: i1.StorageService }, { token: i1.AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22
|
-
TokenIsPresentGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TokenIsPresentGuard });
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TokenIsPresentGuard, decorators: [{
|
|
24
|
-
type: Injectable
|
|
25
|
-
}], ctorParameters: function () { return [{ type: i1.StorageService }, { type: i1.AuthService }]; } });
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "../services";
|
|
4
|
+
export class TokenIsPresentGuard {
|
|
5
|
+
constructor(storageService, authService) {
|
|
6
|
+
this.storageService = storageService;
|
|
7
|
+
this.authService = authService;
|
|
8
|
+
}
|
|
9
|
+
canActivate(routeSnapshot) {
|
|
10
|
+
if (routeSnapshot.queryParams['tokenGuid']) {
|
|
11
|
+
return this.authService
|
|
12
|
+
.getTokenByGuid(routeSnapshot.queryParams['tokenGuid'])
|
|
13
|
+
.toPromise()
|
|
14
|
+
.then((response) => !!response.accessToken);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return !!this.storageService.getToken();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
TokenIsPresentGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TokenIsPresentGuard, deps: [{ token: i1.StorageService }, { token: i1.AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22
|
+
TokenIsPresentGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TokenIsPresentGuard });
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: TokenIsPresentGuard, decorators: [{
|
|
24
|
+
type: Injectable
|
|
25
|
+
}], ctorParameters: function () { return [{ type: i1.StorageService }, { type: i1.AuthService }]; } });
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4taXMtcHJlc2VudC5ndWFyZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC12ZWN0b3ItY29tcG9uZW50cy9zcmMvbGliL2d1YXJkcy90b2tlbi1pcy1wcmVzZW50Lmd1YXJkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7OztBQUszQyxNQUFNLE9BQU8sbUJBQW1CO0lBQzlCLFlBQW9CLGNBQThCLEVBQVUsV0FBd0I7UUFBaEUsbUJBQWMsR0FBZCxjQUFjLENBQWdCO1FBQVUsZ0JBQVcsR0FBWCxXQUFXLENBQWE7SUFBRyxDQUFDO0lBRXhGLFdBQVcsQ0FBQyxhQUFxQztRQUMvQyxJQUFJLGFBQWEsQ0FBQyxXQUFXLENBQUMsV0FBVyxDQUFDLEVBQUU7WUFDMUMsT0FBTyxJQUFJLENBQUMsV0FBVztpQkFDcEIsY0FBYyxDQUFDLGFBQWEsQ0FBQyxXQUFXLENBQUMsV0FBVyxDQUFDLENBQUM7a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