osbert / persona-kit

Clojure micro-library to aid Mozilla Persona user authentication implementation.
11 stars 2 forks source link

calling clojurescript functions #1

Open trevor opened 10 years ago

trevor commented 10 years ago

I'm probably missing something obvious, but from the readme example:

(ns my.app
  (:require [compojure.core :as c]
            [compojure.handler :as h] handler
            [hiccup.page :as p]
            [persona-kit.core :as i]))

;; On your login page, use include-persona to bring in persona resources, 
;; sign-in-button to show the login button.
(c/defroutes app-routes
  (c/GET "/" [] (p/html5 [:head
                          [:title "Login page"]
                          (i/include-persona)]
                         [:body (i/sign-in-button)])))

How are you getting persona-kit.core to have the cljs functions? Only persona-kit.core/valid? and persona-kit.core/verify-assertion are available to me.

osbert commented 10 years ago

Hi, sorry for the lack of a response, I did not get any notification that an issue had been opened, which I will attempt to rectify immediately. This could perhaps be namespaced better, but there are two persona-kit.core namespaces in the project:

When using persona-kit from a ClojureScript project and using cljsbuild, cljsbuild should only build/include the cljs version. However, if you are using a different build system, or trying to use it with Pedestal, I can see this not working as expected and only the Clojure version will be brought in.

Thanks for bringing this potential problem up.