Fork me on GitHub
#reagent
<
2016-07-12
>
shriphani00:07:03

hi, I am trying to add http basic-auth to a simple SPA in reagent and I have no idea where to start - is there a simple example? Thank you very much.

escherize00:07:51

could you describe what you mean by basic-auth?

escherize00:07:05

like signing in with a username and password?

shriphani01:07:59

escherize: sorry I took so long to respond - yes.

shriphani01:07:26

basically you stick in all the fields in the header

shriphani01:07:48

I just want to put a password on a couple of SPAs we have internally but need to expose to some turkers ^.^

novakboskov13:07:05

Is there any widely adopted way to handle Bootstrap modals in Reagent?

novakboskov15:07:54

I've found https://github.com/Frozenlock/reagent-modals in reagent-cookbook but it doesn't work for me due to an error in show-modal!. I've also tried to debug it a little and found that (let [m (js/jQuery (get-modal))] (aget m "modal")) always yields nil when I follow basic example from reagent-cookbook. Perhaps my bootstrap version makes some troubles. it's 4.0.0-alpha.2.

gadfly36115:07:24

@novakboskov: I just tried w/ bootstrap 4 alpha2 and modal seems to work as expected ☝️

novakboskov15:07:58

@gadfly361: Yup, my bad. I forgot to include Bootstraps JS. But, my original question remains the same - Is this widely adopted/mostly used way?

gadfly36115:07:06

I don't think this is widely adopted way, i view it as a convenience lib

gadfly36115:07:06

(and not sure what is widely adopted way, I am not a heavy bootstrap user)

novakboskov18:07:07

@gadfly361: Thanks! You use custom CSS or some other drop-in solution (I'm curious about what Reagent community prefer)?

gadfly36118:07:34

For work, i have been custom rolling CSS, but hoping to eventually use Semantic UI for a project. I think it is pretty complete for what most UIs need and has good ability to theme.

gadfly36118:07:25

Eventually yes, i have been working in a dev branch called v0.1.1. The currently available version should not be used as it is incomplete and will not be supported going forward. Basically, i decided on a re-write bc it was too verbose.

shriphani18:07:50

Hi folks I asked around here yesterday for an example of http basic-auth with reagent - reposting to see if it helps 🙂.

gadfly36118:07:06

@shriphani: If using cljs-ajax (https://github.com/JulianBirch/cljs-ajax), I think you might be looking for this:

:headers {:Authorization "Basic XXX"}
Drop that alongside :handler and :error-handler

shriphani18:07:35

so there’s no buddy magic 🙂

gadfly36118:07:07

i havent used buddy 😞, but for what you are asking, shouldn't be needed

shriphani18:07:03

nice. thx a bunch ^.^

gadfly36118:07:08

np, hope it works