A breakdown of a project that uses XState to manage state for authenticating a user with Cognito, and then finding the authorized application user with an invoked machine.
- create auth machine
- create auth context
- handle AWS authentication
- once user authenticates with Cognito, redirect to user route to get user from db
- at user route use
userMachine
service fromauthMachine
to get application user - once associated application user is found, send user to organization route to allow user to associate session with specific organization