clowder-framework / CONSORT-frontend

custom react frontend working with consort clowder instance
0 stars 0 forks source link

Enable user logout after routing to home #66

Open minump opened 10 months ago

minump commented 10 months ago

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:

  1. 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.
  2. Use something else than "csrf token" to authenticate users in the react app