From 4db3d7a1eefd90e886d09a98c6aa8488f54922a6 Mon Sep 17 00:00:00 2001 From: hackerman <3372410+aeneasr@users.noreply.github.com> Date: Fri, 7 Oct 2022 17:09:29 +0200 Subject: [PATCH] fix: use lower-case abbreviations (#19) --- src/markup-components/index.ts | 2 +- src/react-components/ory/helpers/utils.ts | 2 +- src/react-components/ory/sections/oidc-section.tsx | 4 ++-- src/react-components/ory/sections/oidc-settings-section.tsx | 4 ++-- src/react-components/ory/user-error-card.tsx | 6 +++--- src/react-components/ory/user-settings-card.tsx | 4 ++-- src/stories/Ory/AuthError.stories.tsx | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/markup-components/index.ts b/src/markup-components/index.ts index 23754d7ee..f697ad51e 100644 --- a/src/markup-components/index.ts +++ b/src/markup-components/index.ts @@ -3,7 +3,7 @@ export * from "./components" export * from "./express" export { hasLookupSecret, - hasOIDC, + hasOidc, hasTotp, hasPassword, hasWebauthn, diff --git a/src/react-components/ory/helpers/utils.ts b/src/react-components/ory/helpers/utils.ts index 2d1dc6652..fbd53817c 100644 --- a/src/react-components/ory/helpers/utils.ts +++ b/src/react-components/ory/helpers/utils.ts @@ -1,6 +1,6 @@ import { UiNode } from "@ory/client" -export const hasOIDC = (nodes: UiNode[]) => +export const hasOidc = (nodes: UiNode[]) => nodes.some(({ group }) => group === "oidc") export const hasPassword = (nodes: UiNode[]) => nodes.some(({ group }) => group === "password") diff --git a/src/react-components/ory/sections/oidc-section.tsx b/src/react-components/ory/sections/oidc-section.tsx index eb2ed8baf..9d36ae794 100644 --- a/src/react-components/ory/sections/oidc-section.tsx +++ b/src/react-components/ory/sections/oidc-section.tsx @@ -4,10 +4,10 @@ import { gridStyle } from "../../../theme" import { NodeMessages } from "../helpers/error-messages" import { FilterFlowNodes } from "../helpers/filter-flow-nodes" import { SelfServiceFlow } from "../helpers/types" -import { hasOIDC } from "../helpers/utils" +import { hasOidc } from "../helpers/utils" export const OIDCSection = (flow: SelfServiceFlow): JSX.Element | null => { - return hasOIDC(flow.ui.nodes) ? ( + return hasOidc(flow.ui.nodes) ? (
{ const err = error.error as errorMessage @@ -57,7 +57,7 @@ export const UserErrorCard = ({ )} - Go Back + Go Back
diff --git a/src/react-components/ory/user-settings-card.tsx b/src/react-components/ory/user-settings-card.tsx index 1f11cef0a..3071ee88e 100644 --- a/src/react-components/ory/user-settings-card.tsx +++ b/src/react-components/ory/user-settings-card.tsx @@ -14,7 +14,7 @@ import { OIDCSettingsSection } from "./sections/oidc-settings-section" import { TOTPSettingsSection } from "./sections/totp-settings-section" import { hasLookupSecret, - hasOIDC, + hasOidc, hasPassword, hasTotp, hasWebauthn, @@ -79,7 +79,7 @@ export const UserSettingsCard = ({ } break case "oidc": - if (hasOIDC(flow.ui.nodes)) { + if (hasOidc(flow.ui.nodes)) { hasFlow = true cardTitle = title || "Social Sign In" $flow = diff --git a/src/stories/Ory/AuthError.stories.tsx b/src/stories/Ory/AuthError.stories.tsx index 16e26cfc1..47ed463ab 100644 --- a/src/stories/Ory/AuthError.stories.tsx +++ b/src/stories/Ory/AuthError.stories.tsx @@ -23,6 +23,6 @@ export const ErrorAuthCard = Template.bind({}) ErrorAuthCard.args = { title: "An error occurred", error: authError as SelfServiceError, - backURL: "https://acme.com/login", + backUrl: "https://acme.com/login", contactSupportEmail: "help@help.com", }