oauth2-cli 0.1.4 → 0.1.5
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 +7 -0
- package/dist/Client.js +1 -1
- package/dist/Token.d.ts +1 -1
- package/dist/Token.js +2 -2
- package/package.json +1 -1
- package/src/Client.ts +2 -1
- package/src/Token.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.1.5](https://github.com/battis/oauth2-cli/compare/oauth2-cli/0.1.4...oauth2-cli/0.1.5) (2025-03-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **oauth2-cli:** attempt to reuse refresh_token if none returned ([8210698](https://github.com/battis/oauth2-cli/commit/82106982e508c1f5f54a16590594daa47f80d57d))
|
|
11
|
+
|
|
5
12
|
## [0.1.4](https://github.com/battis/oauth2-cli/compare/oauth2-cli/0.1.3...oauth2-cli/0.1.4) (2025-03-06)
|
|
6
13
|
|
|
7
14
|
|
package/dist/Client.js
CHANGED
|
@@ -41,7 +41,7 @@ export class Client {
|
|
|
41
41
|
let freshTokens;
|
|
42
42
|
if ((freshTokens = Token.fromResponse(await OpenIDClient.refreshTokenGrant(await Configuration.acquire(this.options), token.refresh_token, parameters,
|
|
43
43
|
// @ts-expect-error 2322 undocumented arg pass-through to oauth4webapi
|
|
44
|
-
{ headers })))) {
|
|
44
|
+
{ headers }), token.refresh_token))) {
|
|
45
45
|
return this.store?.save(freshTokens) || freshTokens;
|
|
46
46
|
}
|
|
47
47
|
}
|
package/dist/Token.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class Token implements TokenResponse {
|
|
|
12
12
|
readonly id_token?: string;
|
|
13
13
|
readonly expires_in?: number;
|
|
14
14
|
private constructor();
|
|
15
|
-
static fromResponse(response?: OpenIDClient.TokenEndpointResponse): Token | undefined;
|
|
15
|
+
static fromResponse(response?: OpenIDClient.TokenEndpointResponse, refresh_token?: string): Token | undefined;
|
|
16
16
|
hasExpired(): boolean;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
package/dist/Token.js
CHANGED
|
@@ -13,9 +13,9 @@ export class Token {
|
|
|
13
13
|
this.timestamp = response.timestamp;
|
|
14
14
|
Object.assign(this, response);
|
|
15
15
|
}
|
|
16
|
-
static fromResponse(response) {
|
|
16
|
+
static fromResponse(response, refresh_token) {
|
|
17
17
|
if (response) {
|
|
18
|
-
return new Token({ timestamp: Date.now(), ...response });
|
|
18
|
+
return new Token({ refresh_token, timestamp: Date.now(), ...response });
|
|
19
19
|
}
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/Client.ts
CHANGED
package/src/Token.ts
CHANGED
|
@@ -21,9 +21,12 @@ export class Token implements TokenResponse {
|
|
|
21
21
|
Object.assign(this, response);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
public static fromResponse(
|
|
24
|
+
public static fromResponse(
|
|
25
|
+
response?: OpenIDClient.TokenEndpointResponse,
|
|
26
|
+
refresh_token?: string
|
|
27
|
+
) {
|
|
25
28
|
if (response) {
|
|
26
|
-
return new Token({ timestamp: Date.now(), ...response });
|
|
29
|
+
return new Token({ refresh_token, timestamp: Date.now(), ...response });
|
|
27
30
|
}
|
|
28
31
|
return undefined;
|
|
29
32
|
}
|