This commit is contained in:
Karol Wypchlo 2021-02-22 16:44:02 +01:00
parent 35bc5ab7f7
commit 2ccfcb5751
2 changed files with 4 additions and 3 deletions

View File

@ -23,7 +23,7 @@ export default function SelfServiceForm({ config, fieldsConfig, title }) {
)}
<div>
<input
id={field.name}
id={field.type === "hidden" ? null : field.name}
name={field.name}
type={field.type}
autoComplete={field.autoComplete}

View File

@ -2,10 +2,11 @@ import { Configuration, PublicApi } from "@ory/kratos-client";
import Layout from "../components/Layout";
import config from "../config";
import SelfServiceForm from "../components/Form/SelfServiceForm";
import authServerSideProps from "../services/authServerSideProps";
const kratos = new PublicApi(new Configuration({ basePath: config.kratos.public }));
export async function getServerSideProps(context) {
export const getServerSideProps = authServerSideProps(async (context) => {
const flow = context.query.flow;
if (process.env.NODE_ENV === "development") {
@ -41,7 +42,7 @@ export async function getServerSideProps(context) {
},
};
}
}
});
const fieldsConfig = {
"traits.email": {