Skip to content

Commit

Permalink
chore: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Sep 4, 2023
1 parent 0bbf545 commit e56a94f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
2 changes: 0 additions & 2 deletions src/routes/consent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ export const registerConsentRoute: RouteRegistrator = function (
console.log("found HYDRA_ADMIN_URL")
return app.get(
"/consent",
// @ts-ignore
csrfProtection,
createConsentRoute(createHelpers),
)
Expand All @@ -264,7 +263,6 @@ export const registerConsentPostRoute: RouteRegistrator = function (
return app.post(
"/consent",
parseForm,
// @ts-ignore
csrfProtection,
createConsentPostRoute(createHelpers),
)
Expand Down
30 changes: 15 additions & 15 deletions src/routes/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export const createSettingsRoute: RouteCreator =
return
}

const session = req.session

return frontend
.getSettingsFlow({ id: flow, cookie: req.header("cookie") })
.then(async ({ data: flow }) => {
Expand All @@ -50,23 +48,25 @@ export const createSettingsRoute: RouteCreator =
.then(({ data }) => data.logout_url)
.catch(() => "")) || ""

const settingsScreen = UserSettingsScreen(
{
flow,
logoutUrl,
navClassName: "main-nav",
headerContainerClassName: "spacing-32",
dividerClassName: "divider-left",
settingsCardContainerClassName: "spacing-32",
},
{
locale: res.locals.lang,
},
)
// Render the data using a view (e.g. Jade Template):
res.render("settings", {
layout: "settings",
nodes: flow.ui.nodes,
settingsScreen: UserSettingsScreen(
{
flow,
logoutUrl,
navClassName: "main-nav",
headerContainerClassName: "spacing-32",
dividerClassName: "divider-left",
settingsCardContainerClassName: "spacing-32",
},
{
locale: res.locals.lang,
},
),
nav: settingsScreen.Nav,
settingsScreen: settingsScreen.Body,
})
})
.catch(redirectOnSoftError(res, next, initFlowUrl))
Expand Down
8 changes: 7 additions & 1 deletion views/layouts/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
<body>
<main data-testid="app-express">
<div class="app-container">
{{{body}}}
{{{nav}}}
<div class="container spacing-32">
<div class="content">
{{{body}}}
</div>
{{> ory_branding}}
</div>
</div>
{{> scripts }}
</main>
Expand Down
10 changes: 4 additions & 6 deletions views/settings.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{{{settingsScreen.Nav}}}
<div class="container spacing-32">
<div class="content spacing-32">
{{{settingsScreen.Body}}}
</div>
<div class="spacing-32">

{{> ory_branding }}
<div class="spacing-32">
{{{settingsScreen}}}
</div>

{{> webauthn_setup nodes=nodes webAuthnHandler=webAuthnHandler webauthnTriggerName="webauthn_settings_trigger"}}

Expand Down

0 comments on commit e56a94f

Please sign in to comment.