Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need wrapper for authWithCustomToken. #41

Closed
johanatan opened this issue Sep 24, 2015 · 6 comments
Closed

Need wrapper for authWithCustomToken. #41

johanatan opened this issue Sep 24, 2015 · 6 comments

Comments

@johanatan
Copy link

It would be really nice if you could add the following function: :)

(defn auth-custom [^Firebase ref secret] (.authWithCustomToken ref secret identity))
@crisptrutski
Copy link
Owner

Well, it was nice of you to ask, so sure. Maybe next time send a PR? 😄

Have updated 0.0.8-SNAPSHOT - let me know if you have any issues!

@johanatan
Copy link
Author

I didn't send the PR because I didn't know precisely how you wanted to
handle the cb. But I see now that it was pretty straightforward (following
the existing pattern-- minus the factorization of 'identity'). :)

On Thu, Sep 24, 2015 at 9:03 AM, Chris Truter notifications@github.com
wrote:

Well, it was nice of you to ask, so sure
b5e35a7.
Maybe next time send a PR? [image: 😄]

Have updated 0.0.8-SNAPSHOT - let me know if you have any issues!


Reply to this email directly or view it on GitHub
#41 (comment)
.

@crisptrutski
Copy link
Owner

Feel free to "shoot first" with PRs - can always give feedback, or merge and then touch-up 🔫

@stukennedy
Copy link

How do I use this feature?
I'm trying to do

(m/auth-custom (m/connect "https://FIREBASE.firebaseio.com") "SECRET_KEY" #(prn "connected"))

But I get

Fri Sep 25 14:47:54 BST 2015 [WARN] AuthenticationManager: Received invalid auth data: {auth=null, expires=null}
Fri Sep 25 14:47:54 BST 2015 [WARN] AuthenticationManager: Received invalid auth data: null
Exception in thread "FirebaseEventTarget" clojure.lang.ArityException: Wrong number of args (2) passed to: request/eval20225/fn--20226

@crisptrutski
Copy link
Owner

The issue is the arity of your callback - #(prn "connected") takes no arguments, but it's being called with two.

Try: (m/auth-custom (m/connect "https://FIREBASE.firebaseio.com") "SECRET_KEY" (fn [err auth-data] (prn "connected")))

@stukennedy
Copy link

oh how stupid of me ... thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants