Fork me on GitHub
#keechma
<
2016-06-27
>
bocaj17:06:12

What do you recommend for keeping login session state? I'm working with PostgREST which is set up to give me a JWT (token) .

bocaj17:06:53

POST /login  {:user "x" :pass "xpass"}
returns `{:token "jwt token hash stuff"}

bocaj17:06:30

The plan right now is to store the token in a cookie and before each request, ask if that cookie exists. Then, insert the token in the auth header. The logout controller would remove the cookie

roberto17:06:09

did something change with reagent that I’m getting this warning now: Use of undeclared Var reagent.ratom/make-reaction ?

roberto17:06:17

popped up when testing out the todo-mvc example

bocaj17:06:27

I saw that last week, and it went away with reset-autobuild or something. What versions are in the todomvc?

mihaelkonjevic18:06:08

basically, you have two apps, and the outer app is starting the inner app when the user is logged in

mihaelkonjevic18:06:26

in that moment you can add jwt token info to inner app’s application state

bocaj18:06:38

Ok. I was having trouble keep the current user info after my login app started the main app. I need to use :kv while using entity-db in order keep some state for main-app, yes?

mihaelkonjevic18:06:04

:kv is just a namespce I use for random data (it stands for key - value)

bocaj18:06:14

right, but it's not vacuumed

bocaj18:06:19

..in addition to the name

bocaj18:06:34

entity-db will be blown out after a page-refresh, though. Shouldn't I be using cookies to keep some user identifier?

mihaelkonjevic18:06:53

I usually put it in local storage or cookie