This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-15
Channels
- # announcements (7)
- # aws (30)
- # beginners (141)
- # boot-dev (3)
- # cider (48)
- # clara (35)
- # clojure (94)
- # clojure-europe (6)
- # clojure-italy (20)
- # clojure-nl (19)
- # clojure-norway (1)
- # clojure-portugal (6)
- # clojure-spec (7)
- # clojure-survey (3)
- # clojure-uk (93)
- # clojuredesign-podcast (22)
- # clojurescript (20)
- # core-async (54)
- # cursive (29)
- # datascript (1)
- # datomic (4)
- # emacs (2)
- # fulcro (10)
- # jobs (17)
- # juxt (3)
- # kaocha (20)
- # leiningen (20)
- # malli (22)
- # other-languages (7)
- # pedestal (4)
- # perun (2)
- # quil (2)
- # re-frame (7)
- # reagent (3)
- # reitit (31)
- # shadow-cljs (18)
- # spacemacs (11)
- # vim (32)
is there a proper way to package and import a .js
file in a CLJS lib, so that it can be used by a fighweel-main/deps.edn/clojurescript project?
atm I’m simply putting it on the classpath and importing it via a relative path: https://github.com/Lokeh/helix/blob/master/src/helix/core.cljs#L5 which works great in shadow-cljs
the error in figwheel is weird:
[Figwheel:SEVERE] java.lang.IllegalArgumentException: /_SLASH_impl_SLASH_class/js.cljs is not a relative path
you can try something with goog.provide("helix.core.impl.class")
and use it like any other cljs/closure ns
:thinking_face: attempting to fix that by appending $
to the ns names in my JS file leads to a $jscomp
error in shadow-cljs
Hi, I am trying to make ring-oauth2 working with FB. I am setting it up like this:
(oauth2/wrap-oauth2 handler
{:facebook {:authorize-uri ""
:access-token-uri ""
:client-id fb-id
:client-secret fb-secret
:scopes ["email"]
:launch-uri (b/path-for routes/routes :fb/launch)
:redirect-uri (b/path-for routes/routes :fb/callback)
:landing-uri (b/path-for routes/routes :fb/resolve)}})))
I am getting redirected to http://localhost:3000/login/fb/callback?code=AQDg8bFWIqHGSUOpwuC0JE__MZlm4jY7morHodW5ZSFL480mrPK1LYm9UQsBzKGaN1_dwMBDEygMrsPsjkKtI4eLlexemYDWMkHs84dHdcX4Ewww_YB3eTAq7enq7A4fwJ4G_bg69ewgGPDhCMs-9Ax_m7F9_dP1ncGN_fnIFsz3yenogqjxZqGnDQcjc7DSUrPzkdT8_mEpY7ryB0rgZjJsSpatWv-ROHN7SxO75qQzhPJ-XFZkGaDPqlRi2ChL5xMpEMTSEi37aj6ef_orxyr_veEr6tkKHJ9_w4eTax0LRWIaT-RnzSLdWqu2eBfm1n7fS-1RODmsTreF7oepp5ZT&state=LMMsbgrnpCkF#_=_ and get the following output there:
clojure.lang.ExceptionInfo: clj-http: status 400 {:cached nil, :request-time 213, :repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor 1}, :streaming? true, :http-client #object[org.apache.http.impl.client.InternalHttpClient 0xe150485 "[email protected]"], :chunked? false, :type :clj-http.client/unexceptional-status, :reason-phrase "Bad Request", :headers {"Content-Type" "application/json", "Access-Control-Allow-Origin" "*", "Content-Length" "131", "Alt-Svc" "h3-24=\":443\"; ma=3600", "X-FB-Debug" "feSevDFTF8dSnJw5OHrOs4Ni+HWomFy/mVE4iXEFT5Q6n21oTbKYzVXonVKna0vMr20t4fnkC9rCjW4fwBkImA==", "facebook-api-version" "v2.11", "Strict-Transport-Security" "max-age=15552000; preload", "WWW-Authenticate" "OAuth \"Facebook Platform\" \"invalid_code\" \"Invalid verification code format.\"", "Connection" "close", "Pragma" "no-cache", "Expires" "Sat, 01 Jan 2000 00:00:00 GMT", "x-fb-rev" "1001607678", "x-fb-trace-id" "E3wvIO4CVyS", "Date" "Wed, 15 Jan 2020 18:47:10 GMT", "x-fb-request-id" "A-mrcz2bch-YlNYKTkVhP--", "Cache-Control" "no-store"}, :orig-content-encoding nil, :status 400, :length 131, :body "{\"error\":{\"message\":\"Invalid verification code format.\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"A-mrcz2bch-YlNYKTkVhP--\"}}", :trace-redirects []}
at slingshot.support$stack_trace.invoke(support.clj:201)
at clj_http.client$exceptions_response.invokeStatic(client.clj:245)
at clj_http.client$exceptions_response.invoke(client.clj:236)
at clj_http.client$wrap_exceptions$fn__41203.invoke(client.clj:254)
at clj_http.client$wrap_accept$fn__41449.invoke(client.clj:737)
at clj_http.client$wrap_accept_encoding$fn__41456.invoke(client.clj:759)
at clj_http.client$wrap_content_type$fn__41443.invoke(client.clj:720)
at clj_http.client$wrap_form_params$fn__41552.invoke(client.clj:961)
at clj_http.client$wrap_nested_params$fn__41573.invoke(client.clj:995)
at clj_http.client$wrap_flatten_nested_params$fn__41582.invoke(client.clj:1019)
at clj_http.client$wrap_method$fn__41510.invoke(client.clj:895)
at clj_http.cookies$wrap_cookies$fn__40490.invoke(cookies.clj:131)
at clj_http.links$wrap_links$fn__40978.invoke(links.clj:63)
at clj_http.client$wrap_unknown_host$fn__41590.invoke(client.clj:1048)
at clj_http.client$request_STAR_.invokeStatic(client.clj:1176)
at clj_http.client$request_STAR_.invoke(client.clj:1169)
at clj_http.client$post.invokeStatic(client.clj:1194)
at clj_http.client$post.doInvoke(client.clj:1190)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at ring.middleware.oauth2$get_access_token.invokeStatic(oauth2.clj:65)
at ring.middleware.oauth2$get_access_token.invoke(oauth2.clj:61)
at ring.middleware.oauth2$make_redirect_handler$fn__41733.invoke(oauth2.clj:78)
at ring.middleware.oauth2$wrap_oauth2$fn__41762.invoke(oauth2.clj:101)
at orgpad.server.handler.core$wrap_html_js_css_no_cache$fn__42062.invoke(core.clj:31)
at co.deps.ring_etag_middleware$wrap_file_etag$fn__42002.invoke(ring_etag_middleware.clj:95)
at ring.middleware.not_modified$wrap_not_modified$fn__39952.invoke(not_modified.clj:53)
at ring.middleware.gzip$wrap_gzip$fn__42053.invoke(gzip.clj:100)
at bidi.ring$eval41815$fn__41816.invoke(ring.cljc:25)
at bidi.ring$eval41794$fn__41795$G__41785__41804.invoke(ring.cljc:16)
at bidi.ring$make_handler$fn__41824.invoke(ring.cljc:43)
at clojure.lang.Var.invoke(Var.java:384)
at aleph.http.server$handle_request$fn__16142$f__2135__auto____16143.invoke(server.clj:158)
at clojure.lang.AFn.run(AFn.java:22)
at io.aleph.dirigiste.Executor$Worker$1.run(Executor.java:62)
at manifold.executor$thread_factory$reify__2017$f__2018.invoke(executor.clj:44)
at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Unknown Source)
What am I doing wrong? I am getting "OAuth \"Facebook Platform\" \"invalid_code\" \"Invalid verification code format.\""