File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ module.exports = router => {
5454
5555 } else if ( organisationsUserIsAnAdminAt . length > 1 ) {
5656
57- req . session . data . userId = user . id
57+ req . session . data . currentUserId = user . id
5858 res . redirect ( '/auth/select-mode' )
5959
6060 } else {
@@ -88,15 +88,13 @@ module.exports = router => {
8888
8989 router . get ( '/auth/select-organisation' , ( req , res ) => {
9090 const data = req . session . data
91- const email = data . email
92- const user = data . users . find ( ( user ) => user . email === email )
91+ const user = res . locals . currentUser
9392 const from = req . query . from
9493
9594 const userOrganisationIds = user . organisations . map ( ( organisation ) => organisation . id )
9695 const organisations = data . organisations . filter ( ( organisation ) => userOrganisationIds . includes ( organisation . id ) )
9796
9897 res . render ( 'auth/select-organisation' , {
99- email,
10098 organisations,
10199 from
102100 } )
You can’t perform that action at this time.
0 commit comments