Closed CarlosNZ closed 11 months ago
Note, this does NOT yet work for Postgraphile requests. To do that we need to add some middleware to serve Postgraphile through the main Fastify server (something we want to do when we have time -- @guatemartin is this something you know much about?) @CarlosNZ - Not in the context of a Fasify server or Postgraphile for that matter. I can look at it though if needed.
Back-end required for front-end issue: https://github.com/msupply-foundation/conforma-web-app/issues/1607
(Front-end issue coming shortly)
Just does a basic check on requests to REST server to only allow requests with a current JWT. Expired tokens will return a 401 unauthorised error.
Note, this does NOT yet work for Postgraphile requests. To do that we need to add some middleware to serve Postgraphile through the main Fastify server (something we want to do when we have time -- @guatemartin is this something you know much about?)
To test, just set the
logoutAfterInactivity
preference in server preferences to something small, then try and make REST requests after expiry.