diff --git a/packages/dashboard/src/pages/settings.js b/packages/dashboard/src/pages/settings.js index e3edd1f4..e4ee66bb 100644 --- a/packages/dashboard/src/pages/settings.js +++ b/packages/dashboard/src/pages/settings.js @@ -22,29 +22,19 @@ export async function getServerSideProps(context) { } try { - // console.log("headers", context.req.headers); - const { data: session, headers } = await kratos.whoami( - context.req.headers.cookie, - context.req.headers.authorization - ); - console.log("session", JSON.stringify(session)); - console.log("headers", JSON.stringify(headers)); const { status, data } = await kratos.getSelfServiceSettingsFlow(flow, { headers: { cookie: context.req.headers.cookie }, }); - console.log("status", status); - console.log("data", data); if (status === 200) return { props: { flow: data } }; throw new Error(`Failed to retrieve flow ${flow} with code ${status}`); } catch (error) { return { - props: { error }, - // redirect: { - // permanent: false, - // destination: `${config.kratos.browser}/self-service/settings/browser`, - // }, + redirect: { + permanent: false, + destination: `${config.kratos.browser}/self-service/settings/browser`, + }, }; } } @@ -60,84 +50,88 @@ export async function getServerSideProps(context) { // }, // }; -export default function Settings({ flow, error }) { - console.log("flow", flow); - console.log("error", error); - +export default function Settings({ flow }) { return null; - // const fields = flow.methods.link.config.fields - // .map((field) => ({ - // ...field, - // ...fieldProps[field.name], - // })) - // .sort((a, b) => (a.position < b.position ? -1 : 1)); - // return ( - //
- // or{" "} - // - // sign in - // {" "} - // if you suddenly remembered your password - //
- //