User needs to have the option to logout after being routed to /home (Dashboard).
For now the logout functionality is implemented in express app where it uses csrf token passed along as FormData in the request. See server/routes/auth.js and server/views/home.ejs
However this csrf token is not being passed to the react app (all static files rendered by express) and hence user is unable to logout.
Possible solutions:
Have the top menu bar in express app and have the react app be bound to a div that is below the menu bar :
Now the react app is bound to "app" div. See https://github.com/clowder-framework/CONSORT-frontend/blob/main/src/index.ejs#L27. Have another div on top of the "app div", named "menu-bar". This will be rendered by the express app. The react app will be rendered below the "menu-bar" div.
Use something else than "csrf token" to authenticate users in the react app
User needs to have the option to logout after being routed to
/home
(Dashboard). For now the logout functionality is implemented in express app where it uses csrf token passed along as FormData in the request. Seeserver/routes/auth.js
andserver/views/home.ejs
However this csrf token is not being passed to the react app (all static files rendered by express) and hence user is unable to logout.Possible solutions: