Skip to content

Commit 64852fa

Browse files
authored
[server] fix listAuthProviderDescriptions if unauthenticated (#19094)
1 parent b9189bf commit 64852fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/server/src/api/auth-provider-service-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { AuthProviderEntry, AuthProviderInfo, User } from "@gitpod/gitpod-protoc
2727
import { Unauthenticated } from "./unauthenticated";
2828
import { validate as uuidValidate } from "uuid";
2929
import { selectPage } from "./pagination";
30-
import { ctxUserId } from "../util/request-context";
30+
import { ctxTrySubjectId, ctxUserId } from "../util/request-context";
3131
import { UserService } from "../user/user-service";
3232
import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
3333

@@ -120,7 +120,7 @@ export class AuthProviderServiceAPI implements ServiceImpl<typeof AuthProviderSe
120120
request: ListAuthProviderDescriptionsRequest,
121121
_: HandlerContext,
122122
): Promise<ListAuthProviderDescriptionsResponse> {
123-
const userId = ctxUserId();
123+
const userId = ctxTrySubjectId()?.userId();
124124
let user: User | undefined = undefined;
125125
if (userId) {
126126
user = await this.userService.findUserById(userId, userId);

0 commit comments

Comments
 (0)