Skip to content

Commit b98b03e

Browse files
committed
Add comment
1 parent d92fad4 commit b98b03e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/oidc-utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ class OidcUtils {
170170
return responseJson.access_token;
171171
});
172172
}
173+
/**
174+
* Extracts the access token and username from the CLI output.
175+
* Attempts to parse the input as JSON first, then falls back to regex.
176+
* Currently, in the CLI 2.75.0 version, the output is not a valid JSON.
177+
* This will be fixed in the next versions, but for now we need to support both.
178+
* @param input
179+
*/
173180
static getAccessTokenFromCliOutput(input) {
174181
if (!input) {
175182
throw new Error('Input is empty. Cannot extract values.');

src/oidc-utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ export class OidcUtils {
162162
return responseJson.access_token;
163163
}
164164

165+
/**
166+
* Extracts the access token and username from the CLI output.
167+
* Attempts to parse the input as JSON first, then falls back to regex.
168+
* Currently, in the CLI 2.75.0 version, the output is not a valid JSON.
169+
* This will be fixed in the next versions, but for now we need to support both.
170+
* @param input
171+
*/
165172
public static getAccessTokenFromCliOutput(input: string): { accessToken: string; username: string } {
166173
if (!input) {
167174
throw new Error('Input is empty. Cannot extract values.');

0 commit comments

Comments
 (0)