Skip to content

Commit 979140a

Browse files
committed
fixup allow to change the clientId only
1 parent 9831a4e commit 979140a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

components/dashboard/src/service/json-rpc-authprovider-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ export class JsonRpcAuthProviderClient implements PromiseClient<typeof AuthProvi
113113
if (!request.authProviderId) {
114114
throw new ConnectError("authProviderId is required", Code.InvalidArgument);
115115
}
116-
const clientId = request?.clientId;
117-
const clientSecret = request?.clientSecret;
118-
if (!clientId || !clientSecret) {
116+
const clientId = request?.clientId || "";
117+
const clientSecret = request?.clientSecret || "";
118+
if (!clientId && !clientSecret) {
119119
throw new ConnectError("clientId or clientSecret are required", Code.InvalidArgument);
120120
}
121121

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@ export class AuthProviderService {
227227
if (!existing) {
228228
throw new ApplicationError(ErrorCodes.NOT_FOUND, "Provider resource not found.");
229229
}
230-
const changed =
231-
entry.clientId !== existing.oauth.clientId ||
232-
(entry.clientSecret && entry.clientSecret !== existing.oauth.clientSecret);
230+
231+
// Explicitly check if any update needs to be performed
232+
const changedId = entry.clientId && entry.clientId !== existing.oauth.clientId;
233+
const changedSecret = entry.clientSecret && entry.clientSecret !== existing.oauth.clientSecret;
234+
const changed = changedId || changedSecret;
233235

234236
if (!changed) {
235237
return existing;

0 commit comments

Comments
 (0)