This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-20
Channels
- # announcements (30)
- # babashka (118)
- # beginners (23)
- # calva (68)
- # cljdoc (10)
- # clojars (13)
- # clojure (90)
- # clojure-bangladesh (1)
- # clojure-europe (27)
- # clojure-gamedev (1)
- # clojure-nl (11)
- # clojure-uk (4)
- # clojurescript (59)
- # community-development (3)
- # cursive (13)
- # datomic (39)
- # defnpodcast (1)
- # emacs (10)
- # figwheel-main (1)
- # fulcro (18)
- # graalvm (21)
- # honeysql (1)
- # introduce-yourself (1)
- # juxt (1)
- # lsp (197)
- # malli (19)
- # off-topic (28)
- # practicalli (2)
- # re-frame (42)
- # reagent (4)
- # reitit (7)
- # releases (2)
- # sci (35)
- # shadow-cljs (13)
- # spacemacs (4)
- # vim (3)
I searched this channel history for folks that used AWS Cognito
together with Fulcro and it seems some of you have done this in various ways.
If anyone remembers, what's the "best" way to do it (`AWS amplify` vs. custom implementations)?
Our application is running as Datomic Ion. The SPA is served by the same backend that contains the business logic (as opposed to serving it from S3).
Right now I'm thinking about serving a login-screen from a public route, and keep everything else behind a secured route that watches for a Cognito token
I am working with AWS Amplify right now. To expedite implementation, I am using the Authenticator
component from the Amplify React UI library. If you are going to craft your own signup signin, etc. then I suggest creating a remote for async JS functions. This can be built from examples in the Developer’s Guide and copying code from the Fulcro Github repo.
Thanks for the reply! I've seen a YT tutorial on amplify where they wrap their entire react app in a withAuthentication(app)
call, and that's what I like to do as well.
The CognitoUser
comes from the Cognitor JWT right? So I think parsing the token and adding some user info back to the request header might work (like https://github.com/JarrodCTaylor/ion-cognito-exemplar/blob/main/src/ion_cognito_exemplar/middleware/token_auth.clj).
Is there anything else you keep track of directly in fulcro, like a refresh token or something?
I assumed that the withAuthentication
HOC from amplify takes care of everything, including token refreshes and such.
Are you also using the Amplify CLI?
I am using the Amplify CLI and the dashboard, which is extremely helpful for managing users. withAuthenticator
HOC is definitely a way to go. Amplify lib handles all the token refresh for you — I did not need to process tokens on my own back end.
@UGNMGFJG3 Sorry for bothering you again, but I was just wondering if you're also using Datomic Ions
?
If so, did you add your Cognito Authorizer to the AWS API Gateway?
When using forms, when a field is invalid, is there a way to communicate why it is invalid?
https://github.com/fulcrologic/fulcro-rad/blob/develop/src/main/com/fulcrologic/rad/form_options.cljc#L188 if you're using RAD.
Is there a simple way to show toast messages that will automatically disappear, Some proven react component? that goes well with semantic ui
react-toastify
works very well, I use it for several years now in many different projects. The pathom3
branch of the fulcro-rad-demo
has it baked in: https://github.com/fulcrologic/fulcro-rad-demo/blob/pathom3/src/shared/com/example/client.cljs#L42
In a form I want to convert a field between the input representation (like XXXX-YYYY-ZZZZ) and the model which is XXXXYYYYZZZZ. So I need to change the display of the value but also adjust what user enters as well. What’s the easiest way to plug something like that in?
it is
what I am looking for