Skip to content

Commit

Permalink
fix(frontend): Fix missing credentials input when no credentials avai…
Browse files Browse the repository at this point in the history
…lable

Fixes breakage from f141455 (#8772)
  • Loading branch information
Pwuts committed Nov 27, 2024
1 parent 5dd151b commit 4868e10
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,16 @@ export default function CredentialsProvider({

setProviders((prev) => ({
...prev,
...Object.entries(credentialsByProvider).reduce(
(acc, [provider, { apiKeys, oauthCreds }]) => ({
...acc,
[provider]: {
...Object.fromEntries(
CREDENTIALS_PROVIDER_NAMES.map((provider) => [
provider,
{
provider,
providerName:
providerDisplayNames[provider as CredentialsProviderName],
savedApiKeys: apiKeys,
savedOAuthCredentials: oauthCreds,
savedApiKeys: credentialsByProvider[provider]?.apiKeys ?? [],
savedOAuthCredentials:
credentialsByProvider[provider]?.oauthCreds ?? [],
oAuthCallback: (code: string, state_token: string) =>
oAuthCallback(
provider as CredentialsProviderName,
Expand All @@ -237,8 +238,7 @@ export default function CredentialsProvider({
force,
),
},
}),
{},
]),
),
}));
});
Expand Down

0 comments on commit 4868e10

Please sign in to comment.