Created
          November 25, 2020 03:14 
        
      - 
      
- 
        Save thatmarvin/b55e4a1b3bc4435dc1c27f4892a41043 to your computer and use it in GitHub Desktop. 
    Generated by XState Viz: https://xstate.js.org/viz
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions | |
| // - XState (all XState exports) | |
| const fetchMachine = Machine({ | |
| "id": "setupMfa", | |
| "initial": "startSetup", | |
| "context": { | |
| "method": "totp", | |
| "totpUrl": "", | |
| "recoveryCodes": "", | |
| "phone": "" | |
| }, | |
| "states": { | |
| "startSetup": { | |
| "on": { | |
| "NEXT": "chooseMethod" | |
| } | |
| }, | |
| "chooseMethod": { | |
| "on": { | |
| "CHOOSE_TOTP": "registerTotp", | |
| "CHOOSE_SMS": "verifySms" | |
| } | |
| }, | |
| "registerTotp": { | |
| "on": { | |
| "NEXT": "verifyTotp", | |
| "PREVIOUS": "chooseMethod" | |
| } | |
| }, | |
| "verifyTotp": { | |
| "on": { | |
| "NEXT": "recoveryCodes", | |
| "PREVIOUS": "registerTotp" | |
| } | |
| }, | |
| "verifySms": { | |
| "on": { | |
| "NEXT": "recoveryCodes", | |
| "PREVIOUS": "chooseMethod" | |
| } | |
| }, | |
| "recoveryCodes": { | |
| "on": { | |
| "NEXT": "completed" | |
| } | |
| }, | |
| "completed": { | |
| "type": "final" | |
| } | |
| } | |
| }); | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
https://xstate.js.org/viz/?gist=b55e4a1b3bc4435dc1c27f4892a41043