monkey-front-core 0.0.305 → 0.0.306
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/esm2020/lib/core/interceptors/monkeyecx-http-config-error.interceptor.mjs +1 -1
- package/esm2020/lib/core/interceptors/monkeyecx-http-config-header.interceptor.mjs +9 -10
- package/esm2020/lib/core/services/auth/monkeyecx-auth-guard-company.service.mjs +4 -4
- package/esm2020/lib/core/services/auth/monkeyecx-auth-guard-login.service.mjs +4 -4
- package/esm2020/lib/core/services/auth/monkeyecx-auth-guard.service.mjs +3 -3
- package/esm2020/lib/core/services/auth/monkeyecx-authentication.service.mjs +10 -5
- package/fesm2015/monkey-front-core.mjs +49 -39
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +25 -21
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/interceptors/monkeyecx-http-config-header.interceptor.d.ts +2 -2
- package/lib/core/services/auth/monkeyecx-auth-guard-company.service.d.ts +1 -2
- package/lib/core/services/auth/monkeyecx-auth-guard-login.service.d.ts +1 -2
- package/lib/core/services/auth/monkeyecx-auth-guard.service.d.ts +1 -2
- package/lib/core/services/auth/monkeyecx-authentication.service.d.ts +6 -4
- package/monkey-front-core-0.0.306.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.305.tgz +0 -0
|
@@ -4015,10 +4015,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
4015
4015
|
}]
|
|
4016
4016
|
}], ctorParameters: function () { return [{ type: i1.MonkeyStyleGuideSnackbarService }, { type: i1$1.TranslateService }]; } });
|
|
4017
4017
|
|
|
4018
|
-
/* eslint-disable no-console */
|
|
4019
4018
|
class MonkeyEcxAuthenticationService {
|
|
4020
4019
|
constructor() {
|
|
4021
|
-
this.hadAtLeastOneLogin = () => {
|
|
4020
|
+
this.hadAtLeastOneLogin = async () => {
|
|
4022
4021
|
console.error('hadAtLeastOneLogin needs to be declared!');
|
|
4023
4022
|
return null;
|
|
4024
4023
|
};
|
|
@@ -4030,11 +4029,11 @@ class MonkeyEcxAuthenticationService {
|
|
|
4030
4029
|
console.error('redirectLoginWelcomeBack needs to be declared!');
|
|
4031
4030
|
return null;
|
|
4032
4031
|
};
|
|
4033
|
-
this.isAuthorized = () => {
|
|
4032
|
+
this.isAuthorized = async () => {
|
|
4034
4033
|
console.error('isAuthorized needs to be declared!');
|
|
4035
4034
|
return false;
|
|
4036
4035
|
};
|
|
4037
|
-
this.isCompanyAuthorized = () => {
|
|
4036
|
+
this.isCompanyAuthorized = async () => {
|
|
4038
4037
|
console.error('isCompanyAuthorized needs to be declared!');
|
|
4039
4038
|
return false;
|
|
4040
4039
|
};
|
|
@@ -4050,6 +4049,10 @@ class MonkeyEcxAuthenticationService {
|
|
|
4050
4049
|
console.error('getRequestWithHeadersOb needs to be declared!');
|
|
4051
4050
|
return null;
|
|
4052
4051
|
};
|
|
4052
|
+
this.getRequestWithHeadersAsync = async (request) => {
|
|
4053
|
+
console.error('getRequestWithHeadersAsync needs to be declared!');
|
|
4054
|
+
return null;
|
|
4055
|
+
};
|
|
4053
4056
|
this.refreshShouldHappen = (response) => {
|
|
4054
4057
|
console.error('refreshShouldHappen needs to be declared!');
|
|
4055
4058
|
return false;
|
|
@@ -4070,6 +4073,8 @@ class MonkeyEcxAuthenticationService {
|
|
|
4070
4073
|
this.isCompanyAuthorized = args?.isCompanyAuthorized || this.isCompanyAuthorized.bind(this);
|
|
4071
4074
|
this.getRequestWithHeaders =
|
|
4072
4075
|
args?.getRequestWithHeaders || this.getRequestWithHeaders.bind(this);
|
|
4076
|
+
this.getRequestWithHeadersAsync =
|
|
4077
|
+
args?.getRequestWithHeadersAsync || this.getRequestWithHeadersAsync.bind(this);
|
|
4073
4078
|
this.getRequestWithHeadersOb = args?.getRequestWithHeadersOb.bind(this);
|
|
4074
4079
|
this.refreshShouldHappen = args?.refreshShouldHappen || this.refreshShouldHappen.bind(this);
|
|
4075
4080
|
this.refreshToken = args?.refreshToken || this.refreshToken.bind(this);
|
|
@@ -4087,10 +4092,10 @@ class MonkeyEcxAuthGuardCompany {
|
|
|
4087
4092
|
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
4088
4093
|
// not to do
|
|
4089
4094
|
}
|
|
4090
|
-
canActivate() {
|
|
4095
|
+
async canActivate() {
|
|
4091
4096
|
const { monkeyecxAuthenticationService } = this;
|
|
4092
|
-
if (this.monkeyecxAuthenticationService.isAuthorized()) {
|
|
4093
|
-
if (monkeyecxAuthenticationService.isCompanyAuthorized()) {
|
|
4097
|
+
if (await this.monkeyecxAuthenticationService.isAuthorized()) {
|
|
4098
|
+
if (await monkeyecxAuthenticationService.isCompanyAuthorized()) {
|
|
4094
4099
|
return true;
|
|
4095
4100
|
}
|
|
4096
4101
|
this.monkeyecxAuthenticationService.redirectApp();
|
|
@@ -4112,12 +4117,12 @@ class MonkeyEcxAuthGuardLogin {
|
|
|
4112
4117
|
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
4113
4118
|
// not to do
|
|
4114
4119
|
}
|
|
4115
|
-
canActivate() {
|
|
4116
|
-
if (this.monkeyecxAuthenticationService.isAuthorized()) {
|
|
4120
|
+
async canActivate() {
|
|
4121
|
+
if (await this.monkeyecxAuthenticationService.isAuthorized()) {
|
|
4117
4122
|
this.monkeyecxAuthenticationService.redirectApp();
|
|
4118
4123
|
return false;
|
|
4119
4124
|
}
|
|
4120
|
-
if (this.monkeyecxAuthenticationService.hadAtLeastOneLogin()) {
|
|
4125
|
+
if (await this.monkeyecxAuthenticationService.hadAtLeastOneLogin()) {
|
|
4121
4126
|
this.monkeyecxAuthenticationService.redirectLoginWelcomeBack();
|
|
4122
4127
|
return false;
|
|
4123
4128
|
}
|
|
@@ -4136,9 +4141,9 @@ class MonkeyEcxAuthGuard {
|
|
|
4136
4141
|
this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
|
|
4137
4142
|
// not to do
|
|
4138
4143
|
}
|
|
4139
|
-
canActivate() {
|
|
4144
|
+
async canActivate() {
|
|
4140
4145
|
const { monkeyecxAuthenticationService } = this;
|
|
4141
|
-
if (monkeyecxAuthenticationService.isAuthorized()) {
|
|
4146
|
+
if (await monkeyecxAuthenticationService.isAuthorized()) {
|
|
4142
4147
|
return true;
|
|
4143
4148
|
}
|
|
4144
4149
|
monkeyecxAuthenticationService.redirectLoginWelcomeBack();
|
|
@@ -5347,15 +5352,14 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
|
|
|
5347
5352
|
// not to do
|
|
5348
5353
|
}
|
|
5349
5354
|
}
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
.
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
this.errorHandlingService.handleError(
|
|
5356
|
-
return throwError(
|
|
5357
|
-
}
|
|
5358
|
-
.toPromise();
|
|
5355
|
+
let resp = null;
|
|
5356
|
+
try {
|
|
5357
|
+
resp = await this.authService.getRequestWithHeadersAsync(request);
|
|
5358
|
+
}
|
|
5359
|
+
catch (e) {
|
|
5360
|
+
this.errorHandlingService.handleError(e);
|
|
5361
|
+
return throwError(e);
|
|
5362
|
+
}
|
|
5359
5363
|
return resp;
|
|
5360
5364
|
}
|
|
5361
5365
|
intercept(request, next) {
|