Open tysonzero opened 7 years ago
Haven't done that yet, not sure it's supported by the library. What I would do in such cases is look up the browser functions that do this, wrap them in foreign
declarations with some simple marshalling into haskell types around them, and then start using them.
If you want local storage support to go into the library, you can either post pseudo-code here or open a PR right away, whichever is easier for you.
Yeah that sounds good, will do that at some point. Out of interest how is everyone dealing with things like login tokens and such currently then?
We're using https://github.com/zerobuzz/servant-cookie-session. This takes care of authenticating and protecting the session, but there is certainly room for a higher-level library to make things more convenient.
See also: #29. I propose somebody write an example as described by @tysonzero there and we close both #29 and #32 with that.
It would be really cool if there was a way to automatically, or perhaps just using a small number of helper functions, save and load store data in local storage. In my case I am storing authentication tokens, and I definitely don't want them removed by a refresh. What is the best way to do this at the moment, and if the current way isn't particularly easy how would I go about making a PR for the above?