How to disconnect sessions in Yesod for a specific set of URLs or a child site?

I want to disconnect sessions for headless API endpoints, but I have to enable them because this service also processes user logins.

However, makeSessionBackend does not have access to the Handler element or even to the current URI, such as isAuthorizedSource .

It seems to me that I should pick up the Client Session Backend code and sprinkle it with wrappers until I can get at least a text path from this WAI Request .

Is there a better way to tell any bakend to ignore some routes, like StaticR ?

+6
source share
1 answer

All of your points can be changed by overriding the makeSessionBackend method in the Yesod class class. Sort of

 instance Yesod App where makeSessionBackend _ = fmap Just $ defaultClientSessionBackend expireTime filepath where expireTime = 24 * 60 
+2
source

Source: https://habr.com/ru/post/981812/


All Articles