-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move rtn req. routes and session handling #597
Conversation
Having discussed and agreed a way forward for handling temporary sessions in our code base this demonstrates how we can create the initial session, then retrieve it in subsequent requests. The other thing it does is break the dependence on the return requirement journey sitting under `/licences`. `/licences` is still the gateway to the journey, creating the temporary session for tracking the journey. But it then redirects away so `/return-requirements` can take over. The benefit of this is without any additional controls, we have a way of 'clearing' the session. Essentially, the user simply has to leave the journey and start again and the session is cleared. But whilst in the journey the user can go forwards and backwards throughout and each page can validly assume `sessionId` refers to an existing record.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
seems like there is one thing that needs to be fixed. - https://sonarcloud.io/code?id=DEFRA_water-abstraction-system&branch=lick-it-and-stick-it&selected=DEFRA_water-abstraction-system%3Aapp%2Fcontrollers%2Freturn-requirements.controller.js&line=138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}) | ||
} | ||
|
||
async function saveReturnsHowDoYouWant (request, h) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sonarcloud is complaining about this function being the same as saveNote
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put in a small change to make it pass.
…tual saving of the data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4a036e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I spotted on the first pass I should have flagged but forgot. 😬
app/plugins/auth.plugin.js
Outdated
@@ -47,6 +47,7 @@ const AuthPlugin = { | |||
}, | |||
redirectTo: '/signin', | |||
validate: async (_request, session) => { | |||
console.log('🚀 ~ file: auth.plugin.js:50 ~ validate: ~ session:', session) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh! Something I should have spotted the first time around.
console.log('🚀 ~ file: auth.plugin.js:50 ~ validate: ~ session:', session) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird that it's showing up on my PR.. it's not something I added. but i've removed it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having discussed and agreed a way forward for handling temporary sessions in our code base this demonstrates how we can create the initial session, then retrieve it in subsequent requests. The other thing it does is break the dependence on the return requirement journey sitting under `/licences`. `/licences` is still the gateway to the journey, creating the temporary session for tracking the journey. But it then redirects away so `/return-requirements` can take over. The benefit of this is without any additional controls, we have a way of 'clearing' the session. Essentially, the user simply has to leave the journey and start again and the session is cleared. But whilst in the journey the user can go forwards and backwards throughout and each page can validly assume `sessionId` refers to an existing record. --------- Co-authored-by: Alan Cruikshanks <[email protected]>
Having discussed and agreed a way forward for handling temporary sessions in our code base this demonstrates how we can create the initial session, then retrieve it in subsequent requests. The other thing it does is break the dependence on the return requirement journey sitting under `/licences`. `/licences` is still the gateway to the journey, creating the temporary session for tracking the journey. But it then redirects away so `/return-requirements` can take over. The benefit of this is without any additional controls, we have a way of 'clearing' the session. Essentially, the user simply has to leave the journey and start again and the session is cleared. But whilst in the journey the user can go forwards and backwards throughout and each page can validly assume `sessionId` refers to an existing record. --------- Co-authored-by: Alan Cruikshanks <[email protected]>
Having discussed and agreed a way forward for handling temporary sessions in our code base this demonstrates how we can create the initial session, then retrieve it in subsequent requests. The other thing it does is break the dependence on the return requirement journey sitting under `/licences`. `/licences` is still the gateway to the journey, creating the temporary session for tracking the journey. But it then redirects away so `/return-requirements` can take over. The benefit of this is without any additional controls, we have a way of 'clearing' the session. Essentially, the user simply has to leave the journey and start again and the session is cleared. But whilst in the journey the user can go forwards and backwards throughout and each page can validly assume `sessionId` refers to an existing record. --------- Co-authored-by: Alan Cruikshanks <[email protected]>
Having discussed and agreed a way forward for handling temporary sessions in our code base this demonstrates how we can create the initial session, then retrieve it in subsequent requests. The other thing it does is break the dependence on the return requirement journey sitting under `/licences`. `/licences` is still the gateway to the journey, creating the temporary session for tracking the journey. But it then redirects away so `/return-requirements` can take over. The benefit of this is without any additional controls, we have a way of 'clearing' the session. Essentially, the user simply has to leave the journey and start again and the session is cleared. But whilst in the journey the user can go forwards and backwards throughout and each page can validly assume `sessionId` refers to an existing record. --------- Co-authored-by: Alan Cruikshanks <[email protected]>
Having discussed and agreed a way forward for handling temporary sessions in our code base this demonstrates how we can create the initial session, then retrieve it in subsequent requests.
The other thing it does is break the dependence on the return requirement journey sitting under
/licences
./licences
is still the gateway to the journey, creating the temporary session for tracking the journey. But it then redirects away so/return-requirements
can take over.The benefit of this is without any additional controls, we have a way of 'clearing' the session. Essentially, the user simply has to leave the journey and start again and the session is cleared. But whilst in the journey the user can go forwards and backwards throughout and each page can validly assume
sessionId
refers to an existing record.