Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show correct OIDC provider logo #350

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@
const oidcNodeCount =
ui.nodes.filter((node) => node.group === "oidc").length ?? 0

const Logo = logos[attributes.value]
// Ideally, kratos would return the provider name in the context
// At the moment it only returns the label (misleadingly named `provider`).
// But changing that would be a breaking change.
// So we have to extract the provider name from the id, which sometimes might contain a - followed by a unique ID.
// TODO(kratos): Add provider to the context
const Logo = logos[(attributes.value as string).split("-")[0]]

Check warning on line 67 in packages/elements-react/src/theme/default/components/form/social.tsx

View check run for this annotation

Codecov / codecov/patch

packages/elements-react/src/theme/default/components/form/social.tsx#L67

Added line #L67 was not covered by tests

const showLabel =
_showLabel ?? (oidcNodeCount % 3 !== 0 && oidcNodeCount % 4 !== 0)
Expand Down
Loading