monocle
monocle copied to clipboard
Follow-up PR #967 - Rely on the API to get authenticated user info and manage logout
Here is a proposal
- [ ] Update the
whoiam[1] endpoint to return the authenticated user's info as well as the expiration date of the JWT token. - [ ] Before the rendering the Web APP must call the
whoamiendpoint to discovered if the user own an authenticated session. The Web APP's store is then filed accordingly. - [ ] Add a new logout API endpoint that use servant-auth-server clear-session [2]
[1] https://github.com/change-metrics/monocle/blob/master/src/Monocle/Api/Server.hs#L100 [2] https://hackage.haskell.org/package/servant-auth-server-0.4.7.0/docs/src/Servant.Auth.Server.Internal.Cookie.html#clearSession