This commit is contained in:
Karol Wypchlo 2021-02-17 13:36:20 +01:00
parent 25a42dffaf
commit 00f7dd3a0b
1 changed files with 11 additions and 3 deletions

View File

@ -22,11 +22,19 @@ export async function getServerSideProps(context) {
}
try {
const { status, data } = await kratos.getSelfServiceSettingsFlow(flow);
console.log("Cookie", context.req.getHeader("Cookie"));
console.log("Authorization", context.req.getHeader("Authorization"));
const { data: session } = await kratos.whoami(
context.req.getHeader("Cookie"),
context.req.getHeader("Authorization")
);
console.log(session);
return { flow: "NOT YET" };
// const { status, data } = await kratos.getSelfServiceSettingsFlow(flow);
if (status === 200) return { props: { flow: data } };
// if (status === 200) return { props: { flow: data } };
throw new Error(`Failed to retrieve flow ${flow} with code ${status}`);
// throw new Error(`Failed to retrieve flow ${flow} with code ${status}`);
} catch (error) {
console.log(error);