@abp/ng.oauth 7.2.2 → 7.3.0-rc.1
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 → esm2022}/abp-ng.oauth.mjs +4 -4
- package/{esm2020 → esm2022}/lib/guards/index.mjs +1 -1
- package/esm2022/lib/guards/oauth.guard.mjs +32 -0
- package/{esm2020 → esm2022}/lib/handlers/index.mjs +1 -1
- package/esm2022/lib/handlers/oauth-configuration.handler.mjs +37 -0
- package/esm2022/lib/interceptors/api.interceptor.mjs +57 -0
- package/{esm2020 → esm2022}/lib/interceptors/index.mjs +1 -1
- package/esm2022/lib/oauth.module.mjs +66 -0
- package/{esm2020 → esm2022}/lib/providers/index.mjs +1 -1
- package/{esm2020 → esm2022}/lib/providers/navigate-to-manage-profile.provider.mjs +18 -18
- package/{esm2020 → esm2022}/lib/services/index.mjs +1 -1
- package/esm2022/lib/services/oauth.service.mjs +62 -0
- package/esm2022/lib/strategies/auth-code-flow-strategy.mjs +40 -0
- package/esm2022/lib/strategies/auth-flow-strategy.mjs +81 -0
- package/{esm2020 → esm2022}/lib/strategies/auth-password-flow-strategy.mjs +66 -66
- package/{esm2020 → esm2022}/lib/strategies/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/tokens/auth-flow-strategy.mjs +10 -10
- package/{esm2020 → esm2022}/lib/tokens/index.mjs +1 -1
- package/{esm2020 → esm2022}/lib/utils/auth-utils.mjs +25 -25
- package/{esm2020 → esm2022}/lib/utils/check-access-token.mjs +10 -10
- package/{esm2020 → esm2022}/lib/utils/clear-o-auth-storage.mjs +18 -18
- package/{esm2020 → esm2022}/lib/utils/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/utils/oauth-storage.mjs +1 -1
- package/{esm2020 → esm2022}/lib/utils/storage.factory.mjs +4 -4
- package/{esm2020 → esm2022}/public-api.mjs +9 -9
- package/{fesm2020 → fesm2022}/abp-ng.oauth.mjs +436 -412
- package/fesm2022/abp-ng.oauth.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/guards/index.d.ts +1 -1
- package/lib/guards/oauth.guard.d.ts +13 -13
- package/lib/handlers/index.d.ts +1 -1
- package/lib/handlers/oauth-configuration.handler.d.ts +12 -12
- package/lib/interceptors/api.interceptor.d.ts +15 -15
- package/lib/interceptors/index.d.ts +1 -1
- package/lib/oauth.module.d.ts +10 -10
- package/lib/providers/index.d.ts +1 -1
- package/lib/providers/navigate-to-manage-profile.provider.d.ts +2 -2
- package/lib/services/index.d.ts +1 -1
- package/lib/services/oauth.service.d.ts +21 -21
- package/lib/strategies/auth-code-flow-strategy.d.ts +11 -11
- package/lib/strategies/auth-flow-strategy.d.ts +28 -26
- package/lib/strategies/auth-password-flow-strategy.d.ts +184 -184
- package/lib/strategies/index.d.ts +3 -3
- package/lib/tokens/auth-flow-strategy.d.ts +7 -7
- package/lib/tokens/index.d.ts +1 -1
- package/lib/utils/auth-utils.d.ts +4 -4
- package/lib/utils/check-access-token.d.ts +2 -2
- package/lib/utils/clear-o-auth-storage.d.ts +2 -2
- package/lib/utils/index.d.ts +5 -5
- package/lib/utils/oauth-storage.d.ts +1 -1
- package/lib/utils/storage.factory.d.ts +2 -2
- package/package.json +7 -13
- package/public-api.d.ts +9 -9
- package/esm2020/lib/guards/oauth.guard.mjs +0 -29
- package/esm2020/lib/handlers/oauth-configuration.handler.mjs +0 -36
- package/esm2020/lib/interceptors/api.interceptor.mjs +0 -56
- package/esm2020/lib/oauth.module.mjs +0 -65
- package/esm2020/lib/services/oauth.service.mjs +0 -61
- package/esm2020/lib/strategies/auth-code-flow-strategy.mjs +0 -35
- package/esm2020/lib/strategies/auth-flow-strategy.mjs +0 -64
- package/fesm2015/abp-ng.oauth.mjs +0 -469
- package/fesm2015/abp-ng.oauth.mjs.map +0 -1
- package/fesm2020/abp-ng.oauth.mjs.map +0 -1
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
import { Params } from '@angular/router';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { AuthFlowStrategy } from './auth-flow-strategy';
|
|
4
|
-
import { LoginParams } from '@abp/ng.core';
|
|
5
|
-
export declare class AuthPasswordFlowStrategy extends AuthFlowStrategy {
|
|
6
|
-
readonly isInternalAuth = true;
|
|
7
|
-
private cookieKey;
|
|
8
|
-
private storageKey;
|
|
9
|
-
private listenToTokenExpiration;
|
|
10
|
-
init(): Promise<void>;
|
|
11
|
-
navigateToLogin(queryParams?: Params): Promise<boolean>;
|
|
12
|
-
checkIfInternalAuth(): boolean;
|
|
13
|
-
login(params: LoginParams): Observable<any>;
|
|
14
|
-
logout(queryParams?: Params): Observable<{
|
|
15
|
-
localization?: {
|
|
16
|
-
values?: {
|
|
17
|
-
[x: string]: {
|
|
18
|
-
[x: string]: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
resources?: {
|
|
22
|
-
[x: string]: {
|
|
23
|
-
texts?: {
|
|
24
|
-
[x: string]: string;
|
|
25
|
-
};
|
|
26
|
-
baseResources?: string[];
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
languages?: import("@abp/ng.core").LanguageInfo[];
|
|
30
|
-
currentCulture?: {
|
|
31
|
-
displayName?: string;
|
|
32
|
-
englishName?: string;
|
|
33
|
-
threeLetterIsoLanguageName?: string;
|
|
34
|
-
twoLetterIsoLanguageName?: string;
|
|
35
|
-
isRightToLeft?: boolean;
|
|
36
|
-
cultureName?: string;
|
|
37
|
-
name?: string;
|
|
38
|
-
nativeName?: string;
|
|
39
|
-
dateTimeFormat?: {
|
|
40
|
-
calendarAlgorithmType?: string;
|
|
41
|
-
dateTimeFormatLong?: string;
|
|
42
|
-
shortDatePattern?: string;
|
|
43
|
-
fullDateTimePattern?: string;
|
|
44
|
-
dateSeparator?: string;
|
|
45
|
-
shortTimePattern?: string;
|
|
46
|
-
longTimePattern?: string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
defaultResourceName?: string;
|
|
50
|
-
languagesMap?: {
|
|
51
|
-
[x: string]: import("@abp/ng.core").NameValue<string>[];
|
|
52
|
-
};
|
|
53
|
-
languageFilesMap?: {
|
|
54
|
-
[x: string]: import("@abp/ng.core").NameValue<string>[];
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
auth?: {
|
|
58
|
-
grantedPolicies?: {
|
|
59
|
-
[x: string]: boolean;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
setting?: {
|
|
63
|
-
values?: {
|
|
64
|
-
[x: string]: string;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
currentUser?: {
|
|
68
|
-
isAuthenticated?: boolean;
|
|
69
|
-
id?: string;
|
|
70
|
-
tenantId?: string;
|
|
71
|
-
impersonatorUserId?: string;
|
|
72
|
-
impersonatorTenantId?: string;
|
|
73
|
-
impersonatorUserName?: string;
|
|
74
|
-
impersonatorTenantName?: string;
|
|
75
|
-
userName?: string;
|
|
76
|
-
name?: string;
|
|
77
|
-
surName?: string;
|
|
78
|
-
email?: string;
|
|
79
|
-
emailVerified?: boolean;
|
|
80
|
-
phoneNumber?: string;
|
|
81
|
-
phoneNumberVerified?: boolean;
|
|
82
|
-
roles?: string[];
|
|
83
|
-
};
|
|
84
|
-
features?: {
|
|
85
|
-
values?: {
|
|
86
|
-
[x: string]: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
globalFeatures?: {
|
|
90
|
-
enabledFeatures?: string[];
|
|
91
|
-
};
|
|
92
|
-
multiTenancy?: {
|
|
93
|
-
isEnabled?: boolean;
|
|
94
|
-
};
|
|
95
|
-
currentTenant?: {
|
|
96
|
-
id?: string;
|
|
97
|
-
name?: string;
|
|
98
|
-
isAvailable?: boolean;
|
|
99
|
-
};
|
|
100
|
-
timing?: {
|
|
101
|
-
timeZone?: {
|
|
102
|
-
iana?: {
|
|
103
|
-
timeZoneName?: string;
|
|
104
|
-
};
|
|
105
|
-
windows?: {
|
|
106
|
-
timeZoneId?: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
clock?: {
|
|
111
|
-
kind?: string;
|
|
112
|
-
};
|
|
113
|
-
objectExtensions?: {
|
|
114
|
-
modules?: {
|
|
115
|
-
[x: string]: {
|
|
116
|
-
entities?: {
|
|
117
|
-
[x: string]: {
|
|
118
|
-
properties?: {
|
|
119
|
-
[x: string]: {
|
|
120
|
-
type?: string;
|
|
121
|
-
typeSimple?: string;
|
|
122
|
-
displayName?: {
|
|
123
|
-
name?: string;
|
|
124
|
-
resource?: string;
|
|
125
|
-
};
|
|
126
|
-
api?: {
|
|
127
|
-
onGet?: {
|
|
128
|
-
isAvailable?: boolean;
|
|
129
|
-
};
|
|
130
|
-
onCreate?: {
|
|
131
|
-
isAvailable?: boolean;
|
|
132
|
-
};
|
|
133
|
-
onUpdate?: {
|
|
134
|
-
isAvailable?: boolean;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
ui?: {
|
|
138
|
-
onTable?: {
|
|
139
|
-
isVisible?: boolean;
|
|
140
|
-
};
|
|
141
|
-
onCreateForm?: {
|
|
142
|
-
isVisible?: boolean;
|
|
143
|
-
};
|
|
144
|
-
onEditForm?: {
|
|
145
|
-
isVisible?: boolean;
|
|
146
|
-
};
|
|
147
|
-
lookup?: {
|
|
148
|
-
url?: string;
|
|
149
|
-
resultListPropertyName?: string;
|
|
150
|
-
displayPropertyName?: string;
|
|
151
|
-
valuePropertyName?: string;
|
|
152
|
-
filterParamName?: string;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
attributes?: import("@abp/ng.core").ExtensionPropertyAttributeDto[];
|
|
156
|
-
configuration?: {
|
|
157
|
-
[x: string]: object;
|
|
158
|
-
};
|
|
159
|
-
defaultValue?: object;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
configuration?: {
|
|
163
|
-
[x: string]: object;
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
configuration?: {
|
|
168
|
-
[x: string]: object;
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
enums?: {
|
|
173
|
-
[x: string]: {
|
|
174
|
-
fields?: import("@abp/ng.core").ExtensionEnumFieldDto[];
|
|
175
|
-
localizationResource?: string;
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
extraProperties?: {
|
|
180
|
-
[x: string]: object;
|
|
181
|
-
};
|
|
182
|
-
}>;
|
|
183
|
-
protected refreshToken(): Promise<void | import("angular-oauth2-oidc").TokenResponse>;
|
|
184
|
-
}
|
|
1
|
+
import { Params } from '@angular/router';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { AuthFlowStrategy } from './auth-flow-strategy';
|
|
4
|
+
import { LoginParams } from '@abp/ng.core';
|
|
5
|
+
export declare class AuthPasswordFlowStrategy extends AuthFlowStrategy {
|
|
6
|
+
readonly isInternalAuth = true;
|
|
7
|
+
private cookieKey;
|
|
8
|
+
private storageKey;
|
|
9
|
+
private listenToTokenExpiration;
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
navigateToLogin(queryParams?: Params): Promise<boolean>;
|
|
12
|
+
checkIfInternalAuth(): boolean;
|
|
13
|
+
login(params: LoginParams): Observable<any>;
|
|
14
|
+
logout(queryParams?: Params): Observable<{
|
|
15
|
+
localization?: {
|
|
16
|
+
values?: {
|
|
17
|
+
[x: string]: {
|
|
18
|
+
[x: string]: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
resources?: {
|
|
22
|
+
[x: string]: {
|
|
23
|
+
texts?: {
|
|
24
|
+
[x: string]: string;
|
|
25
|
+
};
|
|
26
|
+
baseResources?: string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
languages?: import("@abp/ng.core").LanguageInfo[];
|
|
30
|
+
currentCulture?: {
|
|
31
|
+
displayName?: string;
|
|
32
|
+
englishName?: string;
|
|
33
|
+
threeLetterIsoLanguageName?: string;
|
|
34
|
+
twoLetterIsoLanguageName?: string;
|
|
35
|
+
isRightToLeft?: boolean;
|
|
36
|
+
cultureName?: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
nativeName?: string;
|
|
39
|
+
dateTimeFormat?: {
|
|
40
|
+
calendarAlgorithmType?: string;
|
|
41
|
+
dateTimeFormatLong?: string;
|
|
42
|
+
shortDatePattern?: string;
|
|
43
|
+
fullDateTimePattern?: string;
|
|
44
|
+
dateSeparator?: string;
|
|
45
|
+
shortTimePattern?: string;
|
|
46
|
+
longTimePattern?: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
defaultResourceName?: string;
|
|
50
|
+
languagesMap?: {
|
|
51
|
+
[x: string]: import("@abp/ng.core").NameValue<string>[];
|
|
52
|
+
};
|
|
53
|
+
languageFilesMap?: {
|
|
54
|
+
[x: string]: import("@abp/ng.core").NameValue<string>[];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
auth?: {
|
|
58
|
+
grantedPolicies?: {
|
|
59
|
+
[x: string]: boolean;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
setting?: {
|
|
63
|
+
values?: {
|
|
64
|
+
[x: string]: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
currentUser?: {
|
|
68
|
+
isAuthenticated?: boolean;
|
|
69
|
+
id?: string;
|
|
70
|
+
tenantId?: string;
|
|
71
|
+
impersonatorUserId?: string;
|
|
72
|
+
impersonatorTenantId?: string;
|
|
73
|
+
impersonatorUserName?: string;
|
|
74
|
+
impersonatorTenantName?: string;
|
|
75
|
+
userName?: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
surName?: string;
|
|
78
|
+
email?: string;
|
|
79
|
+
emailVerified?: boolean;
|
|
80
|
+
phoneNumber?: string;
|
|
81
|
+
phoneNumberVerified?: boolean;
|
|
82
|
+
roles?: string[];
|
|
83
|
+
};
|
|
84
|
+
features?: {
|
|
85
|
+
values?: {
|
|
86
|
+
[x: string]: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
globalFeatures?: {
|
|
90
|
+
enabledFeatures?: string[];
|
|
91
|
+
};
|
|
92
|
+
multiTenancy?: {
|
|
93
|
+
isEnabled?: boolean;
|
|
94
|
+
};
|
|
95
|
+
currentTenant?: {
|
|
96
|
+
id?: string;
|
|
97
|
+
name?: string;
|
|
98
|
+
isAvailable?: boolean;
|
|
99
|
+
};
|
|
100
|
+
timing?: {
|
|
101
|
+
timeZone?: {
|
|
102
|
+
iana?: {
|
|
103
|
+
timeZoneName?: string;
|
|
104
|
+
};
|
|
105
|
+
windows?: {
|
|
106
|
+
timeZoneId?: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
clock?: {
|
|
111
|
+
kind?: string;
|
|
112
|
+
};
|
|
113
|
+
objectExtensions?: {
|
|
114
|
+
modules?: {
|
|
115
|
+
[x: string]: {
|
|
116
|
+
entities?: {
|
|
117
|
+
[x: string]: {
|
|
118
|
+
properties?: {
|
|
119
|
+
[x: string]: {
|
|
120
|
+
type?: string;
|
|
121
|
+
typeSimple?: string;
|
|
122
|
+
displayName?: {
|
|
123
|
+
name?: string;
|
|
124
|
+
resource?: string;
|
|
125
|
+
};
|
|
126
|
+
api?: {
|
|
127
|
+
onGet?: {
|
|
128
|
+
isAvailable?: boolean;
|
|
129
|
+
};
|
|
130
|
+
onCreate?: {
|
|
131
|
+
isAvailable?: boolean;
|
|
132
|
+
};
|
|
133
|
+
onUpdate?: {
|
|
134
|
+
isAvailable?: boolean;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
ui?: {
|
|
138
|
+
onTable?: {
|
|
139
|
+
isVisible?: boolean;
|
|
140
|
+
};
|
|
141
|
+
onCreateForm?: {
|
|
142
|
+
isVisible?: boolean;
|
|
143
|
+
};
|
|
144
|
+
onEditForm?: {
|
|
145
|
+
isVisible?: boolean;
|
|
146
|
+
};
|
|
147
|
+
lookup?: {
|
|
148
|
+
url?: string;
|
|
149
|
+
resultListPropertyName?: string;
|
|
150
|
+
displayPropertyName?: string;
|
|
151
|
+
valuePropertyName?: string;
|
|
152
|
+
filterParamName?: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
attributes?: import("@abp/ng.core").ExtensionPropertyAttributeDto[];
|
|
156
|
+
configuration?: {
|
|
157
|
+
[x: string]: object;
|
|
158
|
+
};
|
|
159
|
+
defaultValue?: object;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
configuration?: {
|
|
163
|
+
[x: string]: object;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
configuration?: {
|
|
168
|
+
[x: string]: object;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
enums?: {
|
|
173
|
+
[x: string]: {
|
|
174
|
+
fields?: import("@abp/ng.core").ExtensionEnumFieldDto[];
|
|
175
|
+
localizationResource?: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
extraProperties?: {
|
|
180
|
+
[x: string]: object;
|
|
181
|
+
};
|
|
182
|
+
}>;
|
|
183
|
+
protected refreshToken(): Promise<void | import("angular-oauth2-oidc").TokenResponse>;
|
|
184
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './auth-flow-strategy';
|
|
2
|
-
export * from './auth-code-flow-strategy';
|
|
3
|
-
export * from './auth-password-flow-strategy';
|
|
1
|
+
export * from './auth-flow-strategy';
|
|
2
|
+
export * from './auth-code-flow-strategy';
|
|
3
|
+
export * from './auth-password-flow-strategy';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
2
|
-
import { AuthCodeFlowStrategy } from '../strategies/auth-code-flow-strategy';
|
|
3
|
-
import { AuthPasswordFlowStrategy } from '../strategies/auth-password-flow-strategy';
|
|
4
|
-
export declare const AUTH_FLOW_STRATEGY: {
|
|
5
|
-
Code(injector: Injector): AuthCodeFlowStrategy;
|
|
6
|
-
Password(injector: Injector): AuthPasswordFlowStrategy;
|
|
7
|
-
};
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { AuthCodeFlowStrategy } from '../strategies/auth-code-flow-strategy';
|
|
3
|
+
import { AuthPasswordFlowStrategy } from '../strategies/auth-password-flow-strategy';
|
|
4
|
+
export declare const AUTH_FLOW_STRATEGY: {
|
|
5
|
+
Code(injector: Injector): AuthCodeFlowStrategy;
|
|
6
|
+
Password(injector: Injector): AuthPasswordFlowStrategy;
|
|
7
|
+
};
|
package/lib/tokens/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './auth-flow-strategy';
|
|
1
|
+
export * from './auth-flow-strategy';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PipeToLoginFn, AbpLocalStorageService } from '@abp/ng.core';
|
|
2
|
-
export declare const pipeToLogin: PipeToLoginFn;
|
|
3
|
-
export declare function setRememberMe(remember: boolean | undefined, localStorageService: AbpLocalStorageService): void;
|
|
4
|
-
export declare function removeRememberMe(localStorageService: AbpLocalStorageService): void;
|
|
1
|
+
import { PipeToLoginFn, AbpLocalStorageService } from '@abp/ng.core';
|
|
2
|
+
export declare const pipeToLogin: PipeToLoginFn;
|
|
3
|
+
export declare function setRememberMe(remember: boolean | undefined, localStorageService: AbpLocalStorageService): void;
|
|
4
|
+
export declare function removeRememberMe(localStorageService: AbpLocalStorageService): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CheckAuthenticationStateFn } from '@abp/ng.core';
|
|
2
|
-
export declare const checkAccessToken: CheckAuthenticationStateFn;
|
|
1
|
+
import { CheckAuthenticationStateFn } from '@abp/ng.core';
|
|
2
|
+
export declare const checkAccessToken: CheckAuthenticationStateFn;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OAuthStorage } from 'angular-oauth2-oidc';
|
|
2
|
-
export declare function clearOAuthStorage(storage?: OAuthStorage): void;
|
|
1
|
+
import { OAuthStorage } from 'angular-oauth2-oidc';
|
|
2
|
+
export declare function clearOAuthStorage(storage?: OAuthStorage): void;
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './oauth-storage';
|
|
2
|
-
export * from './storage.factory';
|
|
3
|
-
export * from './auth-utils';
|
|
4
|
-
export * from './clear-o-auth-storage';
|
|
5
|
-
export * from './check-access-token';
|
|
1
|
+
export * from './oauth-storage';
|
|
2
|
+
export * from './storage.factory';
|
|
3
|
+
export * from './auth-utils';
|
|
4
|
+
export * from './clear-o-auth-storage';
|
|
5
|
+
export * from './check-access-token';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const oAuthStorage: Storage;
|
|
1
|
+
export declare const oAuthStorage: Storage;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OAuthStorage } from 'angular-oauth2-oidc';
|
|
2
|
-
export declare function storageFactory(): OAuthStorage;
|
|
1
|
+
import { OAuthStorage } from 'angular-oauth2-oidc';
|
|
2
|
+
export declare function storageFactory(): OAuthStorage;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abp/ng.oauth",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0-rc.1",
|
|
4
4
|
"homepage": "https://abp.io",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/abpframework/abp.git"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@abp/ng.core": "~7.
|
|
11
|
-
"@abp/utils": "~7.
|
|
10
|
+
"@abp/ng.core": "~7.3.0-rc.1",
|
|
11
|
+
"@abp/utils": "~7.3.0-rc.1",
|
|
12
12
|
"angular-oauth2-oidc": "^15.0.1",
|
|
13
13
|
"just-clone": "^6.1.1",
|
|
14
14
|
"just-compare": "^1.4.0",
|
|
@@ -17,11 +17,7 @@
|
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
|
-
"module": "
|
|
21
|
-
"es2020": "fesm2020/abp-ng.oauth.mjs",
|
|
22
|
-
"esm2020": "esm2020/abp-ng.oauth.mjs",
|
|
23
|
-
"fesm2020": "fesm2020/abp-ng.oauth.mjs",
|
|
24
|
-
"fesm2015": "fesm2015/abp-ng.oauth.mjs",
|
|
20
|
+
"module": "fesm2022/abp-ng.oauth.mjs",
|
|
25
21
|
"typings": "index.d.ts",
|
|
26
22
|
"exports": {
|
|
27
23
|
"./package.json": {
|
|
@@ -29,11 +25,9 @@
|
|
|
29
25
|
},
|
|
30
26
|
".": {
|
|
31
27
|
"types": "./index.d.ts",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"node": "./fesm2015/abp-ng.oauth.mjs",
|
|
36
|
-
"default": "./fesm2020/abp-ng.oauth.mjs"
|
|
28
|
+
"esm2022": "./esm2022/abp-ng.oauth.mjs",
|
|
29
|
+
"esm": "./esm2022/abp-ng.oauth.mjs",
|
|
30
|
+
"default": "./fesm2022/abp-ng.oauth.mjs"
|
|
37
31
|
}
|
|
38
32
|
},
|
|
39
33
|
"sideEffects": false
|
package/public-api.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './lib/oauth.module';
|
|
2
|
-
export * from './lib/utils';
|
|
3
|
-
export * from './lib/tokens';
|
|
4
|
-
export * from './lib/services';
|
|
5
|
-
export * from './lib/strategies';
|
|
6
|
-
export * from './lib/handlers';
|
|
7
|
-
export * from './lib/interceptors';
|
|
8
|
-
export * from './lib/guards';
|
|
9
|
-
export * from './lib/providers';
|
|
1
|
+
export * from './lib/oauth.module';
|
|
2
|
+
export * from './lib/utils';
|
|
3
|
+
export * from './lib/tokens';
|
|
4
|
+
export * from './lib/services';
|
|
5
|
+
export * from './lib/strategies';
|
|
6
|
+
export * from './lib/handlers';
|
|
7
|
+
export * from './lib/interceptors';
|
|
8
|
+
export * from './lib/guards';
|
|
9
|
+
export * from './lib/providers';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { OAuthService } from 'angular-oauth2-oidc';
|
|
3
|
-
import { AuthService } from '@abp/ng.core';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "angular-oauth2-oidc";
|
|
6
|
-
import * as i2 from "@abp/ng.core";
|
|
7
|
-
export class AbpOAuthGuard {
|
|
8
|
-
constructor(oauthService, authService) {
|
|
9
|
-
this.oauthService = oauthService;
|
|
10
|
-
this.authService = authService;
|
|
11
|
-
}
|
|
12
|
-
canActivate() {
|
|
13
|
-
const hasValidAccessToken = this.oauthService.hasValidAccessToken();
|
|
14
|
-
if (hasValidAccessToken) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
this.authService.navigateToLogin();
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
AbpOAuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbpOAuthGuard, deps: [{ token: i1.OAuthService }, { token: i2.AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22
|
-
AbpOAuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbpOAuthGuard, providedIn: 'root' });
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbpOAuthGuard, decorators: [{
|
|
24
|
-
type: Injectable,
|
|
25
|
-
args: [{
|
|
26
|
-
providedIn: 'root',
|
|
27
|
-
}]
|
|
28
|
-
}], ctorParameters: function () { return [{ type: i1.OAuthService }, { type: i2.AuthService }]; } });
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2F1dGguZ3VhcmQuanMiLCJzb3VyY2VSb290Ijo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Itb2F1dGgyLW9pZGMnO1xyXG5pbXBvcnQgeyBPYnNlcnZhYmxlIH0gZnJvbSAncnhqcyc7XHJcbmltcG9ydCB7IEF1dGhTZXJ2aWNlLCBJQXV0aEd1YXJkIH0gZnJvbSAnQGFicC9uZy5jb3JlJztcclxuXHJcbkBJbmplY3RhYmxlKHtcclxuICBwcm92aWRlZEluOiAncm9vdCcsXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBBYnBPQXV0aEd1YXJkIGltcGxlbWVudHMgQ2FuQWN0aXZhdGUsIElBdXRoR3VhcmQge1xyXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgb2F1dGhTZXJ2aWNlOiBPQXV0aFNlcnZpY2UsIHByaXZhdGUgYXV0aFNlcnZpY2U6IEF1dGhTZXJ2aWNlKSB7fVxyXG5cclxuICBjYW5BY3RpdmF0ZSgpOiBPYnNlcnZhYmxlPGJvb2xlYW4+IHwgYm9vbGVhbiB8IFVybFRyZWUge1xyXG4gICAgY29uc3QgaGFzVmFsaWRBY2Nlc3NUb2tlbiA9IHRoaXMub2F1dGhTZXJ2aWNlLmhhc1ZhbGlkQWNjZXNzVG9rZW4oKTtcclxuICAgIGlmIChoYXNWYWxpZEFjY2Vzc1Rva2VuKSB7XHJcbiAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfVxyXG5cclxuICAgIHRoaXMuYXV0aFNlcnZpY2UubmF2aWdhdGVUb0xvZ2luKCk7XHJcbiAgICByZXR1cm4gZmFsc2U7XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Inject, Injectable } from '@angular/core';
|
|
2
|
-
import { OAuthService } from "angular-oauth2-oidc";
|
|
3
|
-
import compare from 'just-compare';
|
|
4
|
-
import { filter, map } from 'rxjs/operators';
|
|
5
|
-
import { EnvironmentService, CORE_OPTIONS } from '@abp/ng.core';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "angular-oauth2-oidc";
|
|
8
|
-
import * as i2 from "@abp/ng.core";
|
|
9
|
-
export class OAuthConfigurationHandler {
|
|
10
|
-
constructor(oAuthService, environmentService, options) {
|
|
11
|
-
this.oAuthService = oAuthService;
|
|
12
|
-
this.environmentService = environmentService;
|
|
13
|
-
this.options = options;
|
|
14
|
-
this.listenToSetEnvironment();
|
|
15
|
-
}
|
|
16
|
-
listenToSetEnvironment() {
|
|
17
|
-
this.environmentService
|
|
18
|
-
.createOnUpdateStream(state => state)
|
|
19
|
-
.pipe(map(environment => environment.oAuthConfig), filter(config => !compare(config, this.options.environment.oAuthConfig)))
|
|
20
|
-
.subscribe((config) => {
|
|
21
|
-
this.oAuthService.configure(config);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
OAuthConfigurationHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: OAuthConfigurationHandler, deps: [{ token: i1.OAuthService }, { token: i2.EnvironmentService }, { token: CORE_OPTIONS }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
26
|
-
OAuthConfigurationHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: OAuthConfigurationHandler, providedIn: 'root' });
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: OAuthConfigurationHandler, decorators: [{
|
|
28
|
-
type: Injectable,
|
|
29
|
-
args: [{
|
|
30
|
-
providedIn: 'root',
|
|
31
|
-
}]
|
|
32
|
-
}], ctorParameters: function () { return [{ type: i1.OAuthService }, { type: i2.EnvironmentService }, { type: undefined, decorators: [{
|
|
33
|
-
type: Inject,
|
|
34
|
-
args: [CORE_OPTIONS]
|
|
35
|
-
}] }]; } });
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2F1dGgtY29uZmlndXJhdGlvbi5oYW5k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