twitter/facebook oath login
Closed this issue · 5 comments
stukennedy commented
Is there a way to a matchbox equivalent of the Firebase twitter/facebook OAuth?
i.e. the CLJS version of this
var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
ref.authWithOAuthRedirect("twitter", function(error) {
if (error) {
console.log("Login Failed!", error);
}
});
crisptrutski commented
There's no sugar for this, but you can use interop:
(def ref (m/connect "https://<YOUR-FIREBASE-APP>.firebaseio.com"))
(.authWithOAuthRedirect ref "twitter", (fn [err] (when err (js/console.log "Login Failed!" err))))
Would take a PR to wrap any methods like this in matchbox.core
, if that appeals to you
stukennedy commented
I seem to have figured out the answer to my own question ... I don't think you've created a wrapper function for it yet, anyway I just called it like this and it seemed to work
(def ref (m/connect "https://<YOUR-FIREBASE-APP>.firebaseio.com"))
(defn callback [error]
(prn error))
(.authWithOAuthRedirect ref "twitter" callback)
crisptrutski commented
Oh snap! Glad you came right 😄
stukennedy commented
yeah I may start some PRs ... I love this lib, just a few things I hit in it from time to time.
(plus the documentation)
crisptrutski commented
Extra hands welcome - it has gotten rather quiet here as I've been distracted..