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 (#8834)

Fixes breakage from f141455 (#8772)

Co-authored-by: Nicholas Tindle <[email protected]>
  • Loading branch information
Pwuts and ntindle authored Nov 27, 2024
1 parent ab36433 commit d2f3f53
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 d2f3f53

Please sign in to comment.