Skip to content

Commit

Permalink
FCRM-4556 attempt to get FMP_SESSION cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
markfee committed Nov 23, 2023
1 parent 840a86b commit 4c64289
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion server/routes/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ module.exports = [{
handler: async (request, h) => {
if (typeof request.yar === 'undefined' || typeof request.yar.get('displayError') === 'undefined') {
// return h.view('home', { allowRobots: true, headers: JSON.stringify(request.headers) })
const fmpSession = request.state.FMP_SESSION
const headers = JSON.stringify(request.headers)
// console.log('\nhome\ Request.headers', request.headers)
// console.log('\nhome\ Request.headers Stringified', headers)
return h.view('home', { allowRobots: true, headers: encodeURIComponent(headers) })
return h.view('home', { allowRobots: true, headers: encodeURIComponent(headers), fmpSession: encodeURIComponent(fmpSession) })
} else {
const errMess = request.yar.get('displayError')
request.yar.set('displayError', {})
Expand Down
3 changes: 2 additions & 1 deletion server/views/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ <h2 class="govuk-heading-m" id="subsection-title">
</div>
<script>
document.addEventListener("DOMContentLoaded", () => {
console.log("decodeURIComponent - headers\n", JSON.parse(decodeURIComponent("{{headers}}")))
console.log("headers\n", JSON.parse(decodeURIComponent("{{headers}}")))
console.log("fmpSession\n", decodeURIComponent("{{fmpSession}}"))
})
</script>

Expand Down

0 comments on commit 4c64289

Please sign in to comment.