{
+ setValue(
+ nodeBackButton.attributes.name,
+ nodeBackButton.attributes.value,
+ )
+ }}
+ />
+ )
+}
diff --git a/packages/elements-react/src/components/form/form.tsx b/packages/elements-react/src/components/form/form.tsx
index 79d771cd4..6b13f9a5b 100644
--- a/packages/elements-react/src/components/form/form.tsx
+++ b/packages/elements-react/src/components/form/form.tsx
@@ -77,7 +77,7 @@ export type OryFormProps = PropsWithChildren
export function OryForm({ children }: OryFormProps) {
const { FormContainer } = useComponents()
const flowContainer = useOryFlow()
-
+ console.log(flowContainer)
const methods = useForm({
// TODO: Generify this, so we have typesafety in the submit handler.
defaultValues: computeDefaultValues(flowContainer),
@@ -85,6 +85,9 @@ export function OryForm({ children }: OryFormProps) {
const intl = useIntl()
+ const fields = methods.watch()
+ console.log(fields)
+
const onRedirect: OnRedirectHandler = (url, external) => {
if (external) {
window.location.href = url
@@ -123,7 +126,6 @@ export function OryForm({ children }: OryFormProps) {
if (submitData.method === "code" && submitData.code) {
submitData.resend = ""
}
- console
await onSubmitRegistration(flowContainer, {
onRedirect,
setFlowContainer: handleSuccess,
diff --git a/packages/elements-react/src/components/form/nodes/input.tsx b/packages/elements-react/src/components/form/nodes/input.tsx
index 96d578451..92b729c3e 100644
--- a/packages/elements-react/src/components/form/nodes/input.tsx
+++ b/packages/elements-react/src/components/form/nodes/input.tsx
@@ -10,6 +10,7 @@ import { MouseEventHandler, ReactNode, useEffect, useRef } from "react"
export const NodeInput = ({
node,
attributes,
+ onClick,
}: NodeProps & {
attributes: UiNodeInputAttributes
onClick?: MouseEventHandler
@@ -39,7 +40,13 @@ export const NodeInput = ({
[],
)
- const handleClick: MouseEventHandler = () => {
+ const handleClick: MouseEventHandler = (e) => {
+ if (onClick) {
+ console.log("asd")
+ e.preventDefault()
+ onClick(e)
+ }
+
if (onclickTrigger) {
triggerToWindowCall(onclickTrigger)
}
@@ -52,9 +59,10 @@ export const NodeInput = ({
(attrs.name === "code" && node.group === "code") ||
(attrs.name === "totp_code" && node.group === "totp")
const isCurrentIdentifier =
- attrs.name == "identifier" &&
- node.group === "identifier_first" &&
- attrs.type === "hidden"
+ (attrs.name == "identifier" &&
+ node.group === "identifier_first" &&
+ attrs.type === "hidden") ||
+ attrs.value === "profile:back"
const isResend = attrs.name === "resend" && node.group === "code"
switch (nodeType) {
@@ -86,19 +94,11 @@ export const NodeInput = ({
)
case UiNodeInputAttributesTypeEnum.Hidden:
return (
- <>
- {isCurrentIdentifier && (
-
- )}
-
- >
+
)
default:
if (isPinCodeInput) {
diff --git a/packages/elements-react/src/locales/sv.json b/packages/elements-react/src/locales/sv.json
index c5c8a28bb..b6ab3e5a8 100644
--- a/packages/elements-react/src/locales/sv.json
+++ b/packages/elements-react/src/locales/sv.json
@@ -58,6 +58,7 @@
"identities.messages.1070001": "Lösenord",
"identities.messages.1070002": "{title}",
"identities.messages.1070003": "Spara",
+ "identities.messages.1040008": "Tillbaka",
"identities.messages.1070004": "ID",
"identities.messages.1070005": "Skicka",
"identities.messages.1070006": "Verifiera kod",
@@ -173,4 +174,4 @@
"verification.registration-label": "Har du inget konto?",
"verification.title": "Verifiera ditt konto",
"verification.back-button": "Tillbaka"
-}
+}
\ No newline at end of file
diff --git a/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx b/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx
index f86b2ca1c..b1ab19f33 100644
--- a/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx
+++ b/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx
@@ -1,9 +1,7 @@
import { HeadlessButtonProps } from "@ory/elements-react"
-import { DefaultInput } from "../form/input"
export function DefaultCurrentIdentifierButton({
attributes,
- node,
}: HeadlessButtonProps) {
return (
@@ -12,7 +10,6 @@ export function DefaultCurrentIdentifierButton({
{attributes.value}
-
)
}