keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
sooheon 2018-01-23T17:22:06.000010Z

@mihaelkonjevic in the realworld example, once the user is logged in with jwt, hot code reloading does not log one out. I’m trying to replicate the login functionality, but code changes -> hot reload keeps logging me out. Is the secret sauce in the datasources namespace (current user?)

mihaelkonjevic 2018-01-23T17:24:53.000117Z

on register / login I store the JWT in local storage

mihaelkonjevic 2018-01-23T17:25:04.000429Z

and then get it out from the local storage from the datasource

sooheon 2018-01-23T17:28:34.000537Z

Hah! I thought I’d done that, turns out I spelled the local storage key differently in two places ;P

sooheon 2018-01-23T17:28:42.000448Z

now I see why you have the settings ns

mihaelkonjevic 2018-01-23T17:29:05.000688Z

🙂

mihaelkonjevic 2018-01-23T17:29:31.000585Z

btw, I’m still thinking about the input fields for Korean and similar language

sooheon 2018-01-23T17:29:59.000228Z

let me know what I can do to help with that--my workaround now is just not fully control the form (don’t bind value)

mihaelkonjevic 2018-01-23T17:30:04.000686Z

I think I have and idea how to fix it (probably on the component level), but work is kinda chaotic this week

sooheon 2018-01-23T17:30:24.000498Z

sure, no rush

sooheon 2018-01-23T17:31:28.000170Z

btw, how do you do keepalive/refresh for the jwt?

mihaelkonjevic 2018-01-23T17:32:25.000011Z

either refresh it on each app load

mihaelkonjevic 2018-01-23T17:32:44.000353Z

and return nil if it’s expired

sooheon 2018-01-23T17:33:24.000334Z

mhm. so if you don’t refresh each app load, and that returns nil, that just means user needs to login again?

mihaelkonjevic 2018-01-23T17:33:40.000338Z

yes

mihaelkonjevic 2018-01-23T17:33:52.000867Z

the only issue is if the jwt expires in the middle of user’s session

sooheon 2018-01-23T17:34:17.000391Z

physical session, not server session right? i thought point of jwt was to replace sessions

mihaelkonjevic 2018-01-23T17:34:49.000316Z

yeah, user is clicking around and then requests start to fail because jwt is expired

sooheon 2018-01-23T17:34:57.000519Z

mhm that’s pretty bad

sooheon 2018-01-23T17:35:34.000492Z

it also seems you don’t really decode the jwt clientside, you jsut assume that if it exists, it means they’ve been authenticated?

sooheon 2018-01-23T17:35:55.000616Z

so technically someone can just add a random string as jwt header and make calls

mihaelkonjevic 2018-01-23T17:36:01.000730Z

in this project yeah, but JWT is readable on the client side

sooheon 2018-01-23T17:36:07.000869Z

yeap

mihaelkonjevic 2018-01-23T17:36:21.000770Z

only thing that it ensures is that you can’t tamper with it because of the signature