zavadil-ts-common 2.0.0 → 2.0.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/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/oauth/OAuthTokenManager.d.ts +1 -1
- package/package.json +1 -1
- package/src/oauth/OAuthTokenManager.ts +3 -3
- package/src/oauth/tokenprovider/RefreshTokenProviderUrl.ts +1 -1
|
@@ -23,7 +23,7 @@ export declare class OAuthTokenManager implements OAuthRefreshTokenProvider {
|
|
|
23
23
|
getRefreshToken(): Promise<IdTokenPayload>;
|
|
24
24
|
getRefreshTokenRaw(): Promise<string>;
|
|
25
25
|
setRefreshToken(token?: IdTokenPayload): void;
|
|
26
|
-
|
|
26
|
+
verifyRefreshToken(token: string): Promise<RefreshTokenPayload>;
|
|
27
27
|
login(login: string, password: string): Promise<any>;
|
|
28
28
|
private getAccessTokenInternal;
|
|
29
29
|
getAccessToken(privilege: string): Promise<string>;
|
package/package.json
CHANGED
|
@@ -54,7 +54,7 @@ export class OAuthTokenManager implements OAuthRefreshTokenProvider {
|
|
|
54
54
|
getRefreshToken(): Promise<IdTokenPayload> {
|
|
55
55
|
return this.getRefreshTokenInternal()
|
|
56
56
|
.then(
|
|
57
|
-
(t:
|
|
57
|
+
(t: RefreshTokenPayload) => {
|
|
58
58
|
if (!OAuthUtil.isValidToken(t)) {
|
|
59
59
|
console.log("invalid token", t);
|
|
60
60
|
return Promise.reject('Received invalid ID token!');
|
|
@@ -83,8 +83,8 @@ export class OAuthTokenManager implements OAuthRefreshTokenProvider {
|
|
|
83
83
|
this.refreshToken = token;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
return this.oAuthServer.
|
|
86
|
+
verifyRefreshToken(token: string): Promise<RefreshTokenPayload> {
|
|
87
|
+
return this.oAuthServer.verifyRefreshToken(token);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
login(login: string, password: string): Promise<any> {
|
|
@@ -26,7 +26,7 @@ export class RefreshTokenProviderUrl extends RedirectionProvider implements OAut
|
|
|
26
26
|
if (raw === null || StringUtil.isBlank(raw)) return Promise.reject("No token in URL!");
|
|
27
27
|
return this.client
|
|
28
28
|
.getTokenManager()
|
|
29
|
-
.then(m => m.
|
|
29
|
+
.then(m => m.verifyRefreshToken(raw));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
reset(): Promise<any> {
|