Fork me on GitHub
Yehonathan Sharvit08:01:45

I just discovered how to disable logging in Wrote an (interactive) article about it

Yehonathan Sharvit08:01:07

And updated the doc with the missing information about :logger option in the reconciler creation


@viebel FWIW you can also disable logging at compile time by setting a closure define goog.DEBUG false


(which you should probably be doing for production builds)

Yehonathan Sharvit17:01:51

Thanks @anmonteiro . Although in my case (klipse web app) I need to be able to switch on and off the logger via a url parameter


Question, and pardon the basic-ness: I have a server.clj that can do ring-sessions for logins... but how can I access session variables via cljs? Like, if my user is logged in when they hit my endpoint, and then my om app loads, how can I make sure that the user remains logged in? Is there a way to see the ring session headers / vars in clojurescript?

Joe R. Smith22:01:18

@sova since your clojurescript app is running entirely on the client the only time it will see headers is in a response from the server. Being logged in is likely a combination of a session on the server and, during a request/response cycle between the client-app and the server, some authenticating token in the request or a cookie

Joe R. Smith23:01:56

personally, I recommend having an endpoint you hit with a token in hand that either gives you information about the authenticated user or an error if you need to log in

Joe R. Smith23:01:08

* an endpoint you hit from your clientside app


@solussd I see what you mean, thanks that was my intuition on the topic... It's just kinda strange that my server will "know" a person is logged in thanks to ring-session but then the javascript app (which gets loaded by this very server) must make a telephone call to find out what state it's in


So I'm using sockets with sente. Seems like an okay way to pass back a solution? Like on app load, send a signal to the server that asks for credentials/identity... seems good?


I was thinking about injecting a token/hash into the html page that serves the app... assuming the javascript application can access the whole DOM once it is loaded...