Skip to content

Commit 8f0f816

Browse files
committed
feat: added security refesh token
1 parent 9cf8825 commit 8f0f816

File tree

6 files changed

+76
-74
lines changed

6 files changed

+76
-74
lines changed

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
},
2020
"private": false,
2121
"dependencies": {
22-
"@angular/animations": "^10.0.2",
22+
"@angular/animations": "^10.0.11",
2323
"@angular/cdk": "^10.0.1",
24-
"@angular/common": "^10.0.2",
25-
"@angular/compiler": "^10.0.2",
26-
"@angular/core": "^10.0.2",
27-
"@angular/forms": "^10.0.2",
28-
"@angular/localize": "^10.0.2",
24+
"@angular/common": "^10.0.11",
25+
"@angular/compiler": "^10.0.11",
26+
"@angular/core": "^10.0.11",
27+
"@angular/forms": "^10.0.11",
28+
"@angular/localize": "^10.0.11",
2929
"@angular/material": "^10.0.1",
30-
"@angular/platform-browser": "^10.0.2",
31-
"@angular/platform-browser-dynamic": "^10.0.2",
32-
"@angular/router": "^10.0.2",
30+
"@angular/platform-browser": "^10.0.11",
31+
"@angular/platform-browser-dynamic": "^10.0.11",
32+
"@angular/router": "^10.0.11",
3333
"@craftsjs/alert": "^1.0.0",
3434
"@craftsjs/card": "^1.0.0",
3535
"@craftsjs/core": "^1.0.0",
@@ -49,8 +49,8 @@
4949
"materialize-css": "^1.0.0",
5050
"moment": "^2.24.0",
5151
"ng2-file-upload": "^1.4.0",
52-
"ngx-cookie-service": "^3.0.3",
53-
"ngx-img-cropper": "^9.0.1",
52+
"ngx-cookie-service": "^10.0.1",
53+
"ngx-img-cropper": "^10.0.0",
5454
"normalize-scss": "^7.0.1",
5555
"perfect-scrollbar": "^1.5.0",
5656
"rxjs": "~6.5.4",
@@ -61,8 +61,8 @@
6161
"@angular-devkit/build-angular": "^0.1000.1",
6262
"@angular-devkit/build-ng-packagr": "^0.1000.1",
6363
"@angular/cli": "^10.0.1",
64-
"@angular/compiler-cli": "^10.0.2",
65-
"@angular/language-service": "^10.0.2",
64+
"@angular/compiler-cli": "^10.0.11",
65+
"@angular/language-service": "^10.0.11",
6666
"@types/jasmine": "~3.5.0",
6767
"@types/jasminewd2": "~2.0.3",
6868
"@types/lodash": "4.14.157",

projects/craftsjs-app/src/app/@redux/menu/services/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const menus: MenuModelTenant[] = [
1515
multiOption: false,
1616
url: '/admin/tenants',
1717
exact: true,
18-
permission: 'Page.Tenants',
18+
permission: 'Page.Tenant',
1919
viewTenant: true
2020
},
2121
{

projects/craftsjs-app/src/app/admin/tenant/components/tenant-layout/tenant-layout.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h4>{{'tenant.title' | translate}}</h4>
77
</card-title>
88
</card-header-oval>
9-
<card-header-subtitle *ngIf="'Page.Tenants.Create' | isGranted">
9+
<card-header-subtitle *ngIf="'Page.Tenant.Create' | isGranted">
1010
<button color="accent" mat-raised-button (click)="createTenant()">
1111
<mat-icon suffix>add</mat-icon>
1212
{{'tenant.create' | translate}}

projects/craftsjs-app/src/app/admin/tenant/components/tenant-list/tenant-list.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
{{'general.actions' | translate}}
1313
</mat-header-cell>
1414
<mat-cell class="text-light-gray" *matCellDef="let tenant">
15-
<button mat-icon-button (click)="editTenant(tenant)" *ngIf="'Page.Tenants.Update' | isGranted">
15+
<button mat-icon-button (click)="editTenant(tenant)" *ngIf="'Page.Tenant.Update' | isGranted">
1616
<mat-icon suffix>edit</mat-icon>
1717
</button>
18-
<button *ngIf="'Page.Tenants.Delete' | isGranted" mat-icon-button (click)="deleteTenant(tenant)">
18+
<button *ngIf="'Page.Tenant.Delete' | isGranted" mat-icon-button (click)="deleteTenant(tenant)">
1919
<mat-icon suffix>delete</mat-icon>
2020
</button>
21-
<button *ngIf="'Page.Tenants.Impersonation' | isGranted" mat-icon-button (click)="openModalImpersonation(tenant.id)"
21+
<button *ngIf="'Page.Tenant.Impersonation' | isGranted" mat-icon-button (click)="openModalImpersonation(tenant.id)"
2222
[matTooltip]="'tenant.impersonation' | translate" matTooltipPosition="above">
2323
<mat-icon suffix>supervisor_account</mat-icon>
2424
</button>
@@ -62,8 +62,8 @@
6262
</ng-container>
6363
<!-- edition Column -->
6464

65-
<mat-header-row *matHeaderRowDef="dataSource.displayedColumns | isGrantedActionColumn: ['Page.Tenants.Update', 'Page.Tenants.Delete', 'Page.Tenants.Impersonation']"></mat-header-row>
66-
<mat-row *matRowDef="let row; columns: dataSource.displayedColumns | isGrantedActionColumn: ['Page.Tenants.Update', 'Page.Tenants.Delete', 'Page.Tenants.Impersonation'];"></mat-row>
65+
<mat-header-row *matHeaderRowDef="dataSource.displayedColumns | isGrantedActionColumn: ['Page.Tenant.Update', 'Page.Tenant.Delete', 'Page.Tenant.Impersonation']"></mat-header-row>
66+
<mat-row *matRowDef="let row; columns: dataSource.displayedColumns | isGrantedActionColumn: ['Page.Tenant.Update', 'Page.Tenant.Delete', 'Page.Tenant.Impersonation'];"></mat-row>
6767
</mat-table>
6868
<mat-paginator [length]="dataSource.total$ | async" [pageSize]="10" hidePageSize="true"></mat-paginator>
6969
</div>

projects/craftsjs/boilerplate/src/lib/services/auth.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class AuthService {
6363

6464
private processAuthenticateResult(authenticateResult: LoginResultDto) {
6565
if (authenticateResult.accessToken) {
66-
this.startRefreshTokenTimer(authenticateResult.accessToken, authenticateResult.refreshToken);
66+
// this.startRefreshTokenTimer(authenticateResult.accessToken, authenticateResult.refreshToken);
6767
this.login(authenticateResult.accessToken, authenticateResult.expiresIn);
6868
} else {
6969
console.warn('Unexpected authenticateResult!');
@@ -77,7 +77,7 @@ export class AuthService {
7777
);
7878
}
7979

80-
private startRefreshTokenTimer(token: string, refreshToken: string) {
80+
startRefreshTokenTimer(token: string, refreshToken: string) {
8181
// parse json object from base64 encoded jwt token
8282
const jwtToken = JSON.parse(atob(token.split('.')[1]));
8383

yarn.lock

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@
128128
ora "4.0.4"
129129
rxjs "6.5.5"
130130

131-
"@angular/animations@^10.0.2":
132-
version "10.0.2"
133-
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-10.0.2.tgz#4af6983800c7e6fbb402f7183fc547ae480cb534"
134-
integrity sha512-3fMR574KnaeAon7ZlwYCB2qkUoZ255Y2KwU6Z/ki37U66QZc8XMqf/d4oUiTZgLsJG4a5Whse0IX8Jz5/HAvQQ==
131+
"@angular/animations@^10.0.11":
132+
version "10.0.11"
133+
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-10.0.11.tgz#9925920864ce005a30aa1aa2779380398cf22752"
134+
integrity sha512-nTw9KctjWE+8Jt3TFJu9c7rPT48FRCqEsTvfzcQW0aq4+s6htmnH0DUY26dCVHjvTNoH71jJyA4IsV0ICTw15A==
135135
dependencies:
136136
tslib "^2.0.0"
137137

@@ -170,17 +170,17 @@
170170
universal-analytics "0.4.20"
171171
uuid "8.1.0"
172172

173-
"@angular/common@^10.0.2":
174-
version "10.0.2"
175-
resolved "https://registry.yarnpkg.com/@angular/common/-/common-10.0.2.tgz#8d5422b3a3e1bc405606476b90b0caffc9c9155a"
176-
integrity sha512-zpNB2XD6jinXZjfihoO5Q1Yg7urfpZTt/fitdmwFHCcQ/1qZ9T2BVh8+VqVRkh6Pjxmtvu0uPnJ1a/aZ5f9r9A==
173+
"@angular/common@^10.0.11":
174+
version "10.0.11"
175+
resolved "https://registry.yarnpkg.com/@angular/common/-/common-10.0.11.tgz#37cf662fd2cbf8b8e86d65fe0becac5e3ebe5aa3"
176+
integrity sha512-Y0EKuwA+LBl1QbyitgLkzjRMqOya3fWsl+LqJkXODCg7+aLi69hzhov0qOxkomLyAZhSTD4B7K6etHKDqhLlQQ==
177177
dependencies:
178178
tslib "^2.0.0"
179179

180-
"@angular/compiler-cli@^10.0.2":
181-
version "10.0.2"
182-
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-10.0.2.tgz#8f178a03989e0018890c52807df9e3e03faaf47a"
183-
integrity sha512-LGX86k1hOyaw5aPCjFfoLuPhVLKMENOdCBeNBzZB+H2CUGHfv8OWFB1EzjZO1N07VGR7JoMx9ZWSP7ornhuS4Q==
180+
"@angular/compiler-cli@^10.0.11":
181+
version "10.0.11"
182+
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-10.0.11.tgz#4a540d842a8e08741cb3a9213695d8d8c13ab326"
183+
integrity sha512-65bk23SSuvzFRRh/JfMHRd/S+LcRLaUut9QXWg+wo++en4ctgAPRQ5GLb1dd4ys058bX6l0BTCd2SFRz+44qCA==
184184
dependencies:
185185
canonical-path "1.0.0"
186186
chokidar "^3.0.0"
@@ -196,36 +196,36 @@
196196
tslib "^2.0.0"
197197
yargs "15.3.0"
198198

199-
"@angular/compiler@^10.0.2":
200-
version "10.0.2"
201-
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-10.0.2.tgz#1056af84ad76763f03228aa3a60b63a5cd775944"
202-
integrity sha512-TNE5ESDlRCVneb/K62HOEgLpxuZZTlw8RcmOy5vt3SngEVc576OE/aYsEA6MCwTlqj16GLSS3jGm9HBJcBKUVw==
199+
"@angular/compiler@^10.0.11":
200+
version "10.0.11"
201+
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-10.0.11.tgz#13dbe66202afb32227e2137031ba2f24152828d5"
202+
integrity sha512-v1dA2Nxv0hgXVnpLBcLam7etEArQuvzV15H/0QHZ0xFAsdYu2VZSI1vrB5jlujEfWnNzNhPYNosSQMPnjTkbGw==
203203
dependencies:
204204
tslib "^2.0.0"
205205

206-
"@angular/core@^10.0.2":
207-
version "10.0.2"
208-
resolved "https://registry.yarnpkg.com/@angular/core/-/core-10.0.2.tgz#d2d2c2dd4a9e80dcccc63c274f13ab7397ee5a3b"
209-
integrity sha512-r4M1D2NOdkmmFyvYLHRYSIBKTGNXQarZHDZcm5oEq2eTsRVe2u9MYIeOpHKeVQCQK7XKQVB13IZQP3XpUvljFg==
206+
"@angular/core@^10.0.11":
207+
version "10.0.11"
208+
resolved "https://registry.yarnpkg.com/@angular/core/-/core-10.0.11.tgz#cb64085089e1d709a04d4093ee96709177faebe4"
209+
integrity sha512-9kv+4JmsIVkbGG8NSmtgEFkm8QtFr/TXjyrqEzl81qlZwSG3FpcqQGG0qb2hlwX81LoWQenbBY0g21yTciEZjA==
210210
dependencies:
211211
tslib "^2.0.0"
212212

213-
"@angular/forms@^10.0.2":
214-
version "10.0.2"
215-
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-10.0.2.tgz#fa443f73156640664a9e018aaeb42f85d6d20fcb"
216-
integrity sha512-qnfApb5Q58SFdl8za8i6ijvP0UfVGxxTtIVnf8czVU5Jz5/KYDbPeChVw/aPl3hfXq8jt0Q6Yl99aAm/BNyhpQ==
213+
"@angular/forms@^10.0.11":
214+
version "10.0.11"
215+
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-10.0.11.tgz#87541e729df471bebe0c9897ad2654a928d829ba"
216+
integrity sha512-nG7D7oS0Fa9W9y0khgDuc2zv1RLnZ+5amXKjuRSVTtZSFLjKlAVYJ2UKyTeW2NI00zMs6oX5dxvoFQ9n3QViMw==
217217
dependencies:
218218
tslib "^2.0.0"
219219

220-
"@angular/language-service@^10.0.2":
221-
version "10.0.2"
222-
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-10.0.2.tgz#31f22020be96ab2cf77283e0627f8a6fffedfe36"
223-
integrity sha512-kEMJ3DkprpoGJvEjvH/PZrBKtgCbLtFYtrXHRDy2+92vgCT0Xz6TwzZ2qlwlQSijffOgsV5LwdjI4oxpgVKReQ==
220+
"@angular/language-service@^10.0.11":
221+
version "10.0.11"
222+
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-10.0.11.tgz#db58d296f08dd47d4fb2d749fcb48383bb14053c"
223+
integrity sha512-ZZHDPasHQJF3/TA0FUNLRVUqPMz6hgjN6EbIwhGaz37qLwDVEB/28HFsvFHj/7sxg8DoXLMGITB8NWPQFtNyvg==
224224

225-
"@angular/localize@^10.0.2":
226-
version "10.0.2"
227-
resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-10.0.2.tgz#685bf3835829a6d0824f654879419efc447004bf"
228-
integrity sha512-b3KxcReeXLlA7KexXn4Q6dQSc04oGHpWK1to5KGgdjWIv2uf1fqD9iTJiGhGK5OYFmvp2AwHfpRvYoxO5wNYaA==
225+
"@angular/localize@^10.0.11":
226+
version "10.0.11"
227+
resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-10.0.11.tgz#f30e4eac5a065a25a0e6ab9a5a3a6b1b22dd817c"
228+
integrity sha512-X8R2oSIzMo5Ha8QB93k9S2AYjvpe+haWVBCQIk7XQ1QZ8CynJCSFK9QwUGGUKsCUlNycDJ+sWpP5+fLdQmjPMQ==
229229
dependencies:
230230
"@babel/core" "7.8.3"
231231
glob "7.1.2"
@@ -238,24 +238,24 @@
238238
dependencies:
239239
tslib "^2.0.0"
240240

241-
"@angular/platform-browser-dynamic@^10.0.2":
242-
version "10.0.2"
243-
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-10.0.2.tgz#b752e2110e5a4316087ce7922227b453e423c144"
244-
integrity sha512-R1rt1/Ynm0DHgzMBcduCPoDg2y3MrYZVgT+N0DLobr2nCaVD74vGsJBVCRv7/m1sdCxyhPlOvq8Bm5sRauw2fw==
241+
"@angular/platform-browser-dynamic@^10.0.11":
242+
version "10.0.11"
243+
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-10.0.11.tgz#3d88a2572c16bdcc3a5b100a69bd9675acfb800f"
244+
integrity sha512-FULvtpVBSEHW13CbsoJminvaKtTZETSvmdDqE1NfHtcYZ6YYksc/ipq4elFFZScIITPDvVqoJxlZXX9DC3kKSA==
245245
dependencies:
246246
tslib "^2.0.0"
247247

248-
"@angular/platform-browser@^10.0.2":
249-
version "10.0.2"
250-
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-10.0.2.tgz#518db3bdff9692cc4ec0c871f3305218da66aebd"
251-
integrity sha512-FLS3fYSuWvrDc7PiVCvs4joWZZxDe9+alJi90Sub1oBS/EnxmZpkS0Gr7zQv4MjAvVhNCVoTzL3CaV/SIoZqaw==
248+
"@angular/platform-browser@^10.0.11":
249+
version "10.0.11"
250+
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-10.0.11.tgz#6f553bc6c27a2d7151284c4fd46d559915428be3"
251+
integrity sha512-u3kXnnsuKRUTeA47+SnmGUhs1k9HKVm3rKaXUfqbHouDHz2SMQg/bvWBG5Nq8FFZYdNa3lV6q1l03/Zf7kaZNg==
252252
dependencies:
253253
tslib "^2.0.0"
254254

255-
"@angular/router@^10.0.2":
256-
version "10.0.2"
257-
resolved "https://registry.yarnpkg.com/@angular/router/-/router-10.0.2.tgz#6514540f4f3179d8be3fd23b1f4a0dd02801a314"
258-
integrity sha512-IcA3W+r5T0NC8TM4J9F0VOxG0wr7nJOSef6Qek6utZd6ByLlXxOhBrPIC5Ou+QNZeg9OuI2FBt6coea9jgmNOA==
255+
"@angular/router@^10.0.11":
256+
version "10.0.11"
257+
resolved "https://registry.yarnpkg.com/@angular/router/-/router-10.0.11.tgz#a83fcc2fef2b9f7cb84bd2845ebd4aa3d76a9185"
258+
integrity sha512-YFXBfW1EEq+y+lcYoZuvH1jeyD9ku9N7V5SZi8Ux8KZZ+CjnWRx2bt4PF7fezCGRO6KgfM0xrZI8TKmYOK5OSQ==
259259
dependencies:
260260
tslib "^2.0.0"
261261

@@ -6486,15 +6486,17 @@ ng2-file-upload@^1.4.0:
64866486
dependencies:
64876487
tslib "^1.9.0"
64886488

6489-
ngx-cookie-service@^3.0.3:
6490-
version "3.0.3"
6491-
resolved "https://registry.yarnpkg.com/ngx-cookie-service/-/ngx-cookie-service-3.0.3.tgz#fee43842ce59fce9e5ea4accb96bb4b40d0b1680"
6492-
integrity sha512-LjfYV1TCwALF4s6NSfzowqMjcif4fbqVaN3e2F6fNyeRz2UFkvV7rffz6nBsgpDbQ29VpOYTFoEczRbMt2ZoJg==
6489+
ngx-cookie-service@^10.0.1:
6490+
version "10.0.1"
6491+
resolved "https://registry.yarnpkg.com/ngx-cookie-service/-/ngx-cookie-service-10.0.1.tgz#b05556636a66874b43953b6ee3eea44652c134a3"
6492+
integrity sha512-QRafo2KuAQxdIZhiu2S0DhpwrkPxVDP34NlfluS4NnAU+8TeOPiKwrqZo/y1FYgxKtQgL1gjjs8KQHDYeR/7gQ==
6493+
dependencies:
6494+
tslib "^2.0.0"
64936495

6494-
ngx-img-cropper@^9.0.1:
6495-
version "9.0.1"
6496-
resolved "https://registry.yarnpkg.com/ngx-img-cropper/-/ngx-img-cropper-9.0.1.tgz#929b336af67401edafeb50c617053afd614ad2fb"
6497-
integrity sha512-OLRjdU5ItzO7wjtl1HqHOW1elivIeMmkPcCIzwknybuqLEZgoKHRdh5Ol/xSw86pBSkg4dRwyhzeY4D9zl+Rng==
6496+
ngx-img-cropper@^10.0.0:
6497+
version "10.0.0"
6498+
resolved "https://registry.yarnpkg.com/ngx-img-cropper/-/ngx-img-cropper-10.0.0.tgz#7b2ab40742e52bd953741dc07691cfdf039121a5"
6499+
integrity sha512-Posg1sBVKqOwJWqxHgSaE85+cGR7bM9PxJJXbOkGP26uuLAhF5jQ/mQn5sJDshFCX/XmL6rZkJxB5BuiPLu8cA==
64986500

64996501
nice-try@^1.0.4:
65006502
version "1.0.5"

0 commit comments

Comments
 (0)