豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 9323859

Browse files
committed
fix(ng-dev): use token to determine if the AuthenticatedGitClient has been configured (#773)
Previously we allowed for the AuthenticatedGitClient to be configured multiple times before it `get` was called, however this is incorrect as only one configuration is to be allowed. PR Close #773
1 parent 9a28358 commit 9323859

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/local-actions/changelog/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68650,7 +68650,7 @@ Alternatively, a new token can be created at: ${GITHUB_TOKEN_GENERATE_URL}
6865068650
return AuthenticatedGitClient._authenticatedInstance;
6865168651
}
6865268652
static configure(token, userType = "user") {
68653-
if (AuthenticatedGitClient._authenticatedInstance) {
68653+
if (AuthenticatedGitClient._token) {
6865468654
throw Error("Unable to configure `AuthenticatedGitClient` as it has been configured already.");
6865568655
}
6865668656
AuthenticatedGitClient._token = token;

github-actions/slash-commands/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70023,7 +70023,7 @@ Alternatively, a new token can be created at: ${GITHUB_TOKEN_GENERATE_URL}
7002370023
return AuthenticatedGitClient._authenticatedInstance;
7002470024
}
7002570025
static configure(token, userType = "user") {
70026-
if (AuthenticatedGitClient._authenticatedInstance) {
70026+
if (AuthenticatedGitClient._token) {
7002770027
throw Error("Unable to configure `AuthenticatedGitClient` as it has been configured already.");
7002870028
}
7002970029
AuthenticatedGitClient._token = token;

ng-dev/utils/git/authenticated-git-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class AuthenticatedGitClient extends GitClient {
188188

189189
/** Configures an authenticated git client. */
190190
static configure(token: string, userType: UserType = 'user'): void {
191-
if (AuthenticatedGitClient._authenticatedInstance) {
191+
if (AuthenticatedGitClient._token) {
192192
throw Error(
193193
'Unable to configure `AuthenticatedGitClient` as it has been configured already.',
194194
);

0 commit comments

Comments
 (0)