From 305eb212cdb946107616abc95a8ae29299195a24 Mon Sep 17 00:00:00 2001 From: Henning Perl Date: Fri, 12 Jan 2024 11:29:19 +0100 Subject: [PATCH] fix: bugs from passkey PR (#64) --- pages/registration.tsx | 4 ---- pages/settings.tsx | 2 +- pkg/ui/Flow.tsx | 5 +---- pkg/ui/NodeInputButton.tsx | 6 +----- pkg/ui/NodeInputHidden.tsx | 10 +--------- 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/pages/registration.tsx b/pages/registration.tsx index 968a764..cbee3ab 100644 --- a/pages/registration.tsx +++ b/pages/registration.tsx @@ -48,7 +48,6 @@ const Registration: NextPage = () => { returnTo: returnTo ? String(returnTo) : undefined, }) .then(({ data }) => { - console.log("Created a new registration flow: ", data) setFlow(data) }) .catch(handleFlowError(router, "registration", setFlow)) @@ -60,15 +59,12 @@ const Registration: NextPage = () => { // his data when she/he reloads the page. .push(`/registration?flow=${flow?.id}`, undefined, { shallow: true }) - console.log("updateRegistrationFlow values", values) ory .updateRegistrationFlow({ flow: String(flow?.id), updateRegistrationFlowBody: values, }) .then(async ({ data }) => { - console.log("updateRegistrationFlow data", data) - // If we ended up here, it means we are successfully signed up! // // You can do cool stuff here, like having access to the identity which just signed up: diff --git a/pages/settings.tsx b/pages/settings.tsx index 24d32ef..4d1dc9f 100644 --- a/pages/settings.tsx +++ b/pages/settings.tsx @@ -213,7 +213,7 @@ const Settings: NextPage = () => { flow={flow} /> - +

Manage Passkeys

extends Component, State> { isLoading: true, })) - console.log("form data", body) - console.log("form data state values", this.state.values) - return this.props - .onSubmit({ ...this.state.values, ...body }) + .onSubmit({ ...body, ...this.state.values }) .finally(() => { // We wait for reconciliation and update the state after 50ms // Done submitting - update loading status diff --git a/pkg/ui/NodeInputButton.tsx b/pkg/ui/NodeInputButton.tsx index 6a407a6..9f81874 100644 --- a/pkg/ui/NodeInputButton.tsx +++ b/pkg/ui/NodeInputButton.tsx @@ -1,8 +1,7 @@ import { getNodeLabel } from "@ory/integrations/ui" import { Button } from "@ory/themes" -import { useEffect } from "react" -import { callWebauthnFunction, NodeInputProps, useOnload } from "./helpers" +import { callWebauthnFunction, NodeInputProps } from "./helpers" export function NodeInputButton({ node, @@ -19,7 +18,6 @@ export function NodeInputButton({ // // Please note that we also need to prevent the default action from happening. if (attributes.onclick) { - console.log("onclick", attributes.onclick) e.stopPropagation() e.preventDefault() callWebauthnFunction(attributes.onclick) @@ -29,8 +27,6 @@ export function NodeInputButton({ setValue(attributes.value).then(() => dispatchSubmit(e)) } - // useOnload(attributes as any) - return ( <>