Fork me on GitHub

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.


I am currently working on keeping track of state — CognitoUser and tokens.


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 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.


Awesome, I'll give it a try then. Thanks again!


@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?


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:


Thanks! It works great. with :pauseOnFocusLoss false, just as I want


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?


what I am looking for