{
  "contents": {
    "startTask": "1",
    "tasks": {
      "0": {
        "action": "logged-in",
        "id": "0",
        "name": "End",
        "next": {},
        "type": "automated",
        "view": {
          "x": 2916,
          "y": 336
        }
      },
      "1": {
        "allInputKeys": [
          "email"
        ],
        "calculatedInputKeys": true,
        "id": "1",
        "inputKeys": [
          "email"
        ],
        "name": "Get Email",
        "next": {
          "rules": [
            {
              "interactionId": "t6-aP7tsPA",
              "taskId": "5"
            }
          ]
        },
        "screenId": "SC39wO2aQzjUkncpyrOhQMNHQPCv5",
        "type": "screen",
        "view": {
          "x": 12,
          "y": 132
        }
      },
      "2": {
        "action": "sign-up-or-in-otp-email",
        "arguments": {
          "extraTemplateVals": {
            "type": "inline",
            "value": ""
          },
          "providerId": {
            "type": "inline",
            "value": ""
          },
          "templateId": {
            "type": "inline",
            "value": ""
          }
        },
        "id": "2",
        "name": "Sign Up or In / OTP / Email",
        "next": {
          "rules": [
            {
              "interactionId": "success",
              "taskId": "3"
            }
          ]
        },
        "type": "automated",
        "view": {
          "x": 984,
          "y": 420
        }
      },
      "3": {
        "allInputKeys": [
          "code"
        ],
        "calculatedInputKeys": true,
        "contextKeys": [
          "sentTo.maskedEmail"
        ],
        "id": "3",
        "name": "Verify OTP",
        "next": {
          "rules": [
            {
              "interactionId": "resend",
              "taskId": "2"
            },
            {
              "interactionId": "oneTimeCodeId",
              "taskId": "4"
            }
          ]
        },
        "screenId": "SC39wO2YjeddDmQDKeHBgk94znkhg",
        "type": "screen",
        "view": {
          "x": 1464,
          "y": 420
        }
      },
      "4": {
        "action": "verify-code-otp-email",
        "id": "4",
        "name": "Verify Code / OTP / Email",
        "next": {
          "rules": [
            {
              "interactionId": "success",
              "taskId": "0"
            }
          ]
        },
        "type": "automated",
        "view": {
          "x": 2436,
          "y": 504
        }
      },
      "5": {
        "conditions": [
          {
            "atomicConditions": [
              {
                "operator": "not-empty",
                "predicate": {
                  "type": "inline",
                  "value": ""
                },
                "target": {
                  "type": "context",
                  "value": "unauthUser.userId"
                }
              }
            ],
            "interactionId": "2gsk7bc70b",
            "name": "Yes"
          },
          {
            "interactionId": "ELSE",
            "name": "No"
          }
        ],
        "id": "5",
        "name": "User Exists?",
        "next": {
          "rules": [
            {
              "interactionId": "2gsk7bc70b",
              "taskId": "6"
            },
            {
              "interactionId": "ELSE",
              "taskId": "2"
            }
          ]
        },
        "type": "condition",
        "view": {
          "x": 504,
          "y": 132
        }
      },
      "6": {
        "action": "scriptlet",
        "arguments": {
          "outputPath": {
            "type": "inline",
            "value": "scriptletResult"
          },
          "overrideForm": {
            "type": "inline",
            "value": ""
          },
          "scriptArgs": {
            "type": "inline",
            "value": [
              {
                "key": "email",
                "type": "context",
                "value": "unauthUser.email"
              },
              {
                "key": "userId",
                "type": "context",
                "value": "unauthUser.userId"
              }
            ]
          },
          "scriptCode": {
            "type": "inline",
            "value": "console.log(\"Unauth User email \" + email)\nconsole.log(\"Unauth User userId \" + userId)\nreturn true;\n"
          }
        },
        "errorHandlingV2": {
          "ScriptletFailed": {
            "errorHandlingType": "automatic"
          }
        },
        "id": "6",
        "name": "Log unauthUser info",
        "next": {
          "rules": [
            {
              "interactionId": "success",
              "taskId": "7"
            }
          ]
        },
        "type": "automated",
        "view": {
          "x": 984,
          "y": 168
        }
      },
      "7": {
        "action": "sign-in-otp-email",
        "arguments": {
          "extraTemplateVals": {
            "type": "inline",
            "value": ""
          },
          "providerId": {
            "type": "inline",
            "value": ""
          },
          "templateId": {
            "type": "inline",
            "value": ""
          }
        },
        "id": "7",
        "name": "Sign In / OTP / Email",
        "next": {
          "rules": [
            {
              "interactionId": "success",
              "taskId": "8"
            }
          ]
        },
        "type": "automated",
        "view": {
          "x": 1464,
          "y": 192
        }
      },
      "8": {
        "allInputKeys": [
          "code"
        ],
        "calculatedInputKeys": true,
        "contextKeys": [
          "sentTo.maskedEmail"
        ],
        "id": "8",
        "name": "Verify OTP",
        "next": {
          "rules": [
            {
              "interactionId": "resend",
              "taskId": "7"
            },
            {
              "interactionId": "oneTimeCodeId",
              "taskId": "9"
            }
          ]
        },
        "screenId": "SC39wO2aV9lY85dSQD9AQBv5xVHwZ",
        "type": "screen",
        "view": {
          "x": 1956,
          "y": 180
        }
      },
      "9": {
        "action": "verify-code-otp-email",
        "id": "9",
        "name": "Verify Code / OTP / Email",
        "next": {
          "rules": [
            {
              "interactionId": "success",
              "taskId": "0"
            }
          ]
        },
        "type": "automated",
        "view": {
          "x": 2436,
          "y": 264
        }
      },
      "start": {
        "id": "start",
        "name": "start",
        "next": {
          "rules": [
            {
              "taskId": "1"
            }
          ]
        },
        "view": {
          "x": 12,
          "y": 12
        }
      }
    }
  },
  "flowId": "uath-user-demo",
  "metadata": {
    "componentsVersion": "2.2.50",
    "managementConfig": {
      "triggers": {
        "eventTriggers": {}
      }
    },
    "name": "uathUser-demo",
    "sharedInteractions": [
      {
        "id": "0.success",
        "type": "success"
      },
      {
        "id": "3.pnOqEGpL1b",
        "label": "Choose another authentication method"
      },
      {
        "id": "8.pnOqEGpL1b",
        "label": "Choose another authentication method"
      }
    ]
  },
  "references": {},
  "screens": [
    {
      "contents": {
        "ROOT": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "auED4dEJkJ",
            "eBGiu9cYSb",
            "yZNZ2ZVVu_"
          ],
          "props": {
            "align": "center",
            "background": "",
            "data-editor-type": "container",
            "direction": "column",
            "id": "ROOT",
            "justify": "center",
            "paddingX": "4",
            "paddingY": "4",
            "spaceBetween": "5",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        },
        "auED4dEJkJ": {
          "custom": {},
          "displayName": "Text",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "ROOT",
          "props": {
            "children": "We've sent a message containing a 6-digit code to {{sentTo.maskedEmail}}",
            "full-width": false,
            "id": "auED4dEJkJ",
            "italic": false,
            "mode": "primary",
            "text-align": "center",
            "variant": "subtitle1"
          },
          "type": {
            "resolvedName": "Text"
          }
        },
        "eBGiu9cYSb": {
          "custom": {},
          "displayName": "Text",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "ROOT",
          "props": {
            "children": "Enter Code",
            "full-width": false,
            "id": "eBGiu9cYSb",
            "italic": false,
            "mode": "primary",
            "text-align": "center",
            "variant": "subtitle2"
          },
          "type": {
            "resolvedName": "Text"
          }
        },
        "fyz-aN6hyx": {
          "custom": {},
          "displayName": "Error Message",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "thNbUTWOGY",
          "props": {
            "color": "error",
            "data-type": "error-message",
            "full-width": false,
            "hide-when-empty": true,
            "id": "fyz-aN6hyx",
            "italic": false,
            "mode": "error",
            "text-align": "center",
            "variant": "body1"
          },
          "type": {
            "resolvedName": "ErrorMessage"
          }
        },
        "oOOUcyEOVr": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "resend",
            "pnOqEGpL1b"
          ],
          "parent": "yZNZ2ZVVu_",
          "props": {
            "align": "start",
            "background": "#ffffff00",
            "data-editor-type": "container",
            "direction": "row",
            "id": "oOOUcyEOVr",
            "justify": "center",
            "paddingX": "5",
            "paddingY": "0",
            "spaceBetween": "0",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        },
        "oneTimeCodeId": {
          "custom": {
            "type": "oneTimeCode"
          },
          "displayName": "One Time Code",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "yZNZ2ZVVu_",
          "props": {
            "bordered": true,
            "data-auto-submit": true,
            "data-errormessage-pattern-mismatch": "Must be a 6 digit number",
            "digits": 6,
            "full-width": false,
            "id": "oneTimeCodeId",
            "label": "",
            "name": "code",
            "required": true,
            "size": "lg",
            "type": "tel"
          },
          "type": {
            "resolvedName": "Code"
          }
        },
        "pnOqEGpL1b": {
          "custom": {
            "type": "button"
          },
          "displayName": "Button",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "oOOUcyEOVr",
          "props": {
            "children": "Choose another authentication method",
            "color": "primary",
            "data-type": "button",
            "formNoValidate": true,
            "full-width": true,
            "id": "pnOqEGpL1b",
            "mode": "primary",
            "size": "sm",
            "variant": "link"
          },
          "type": {
            "resolvedName": "Button"
          }
        },
        "resend": {
          "custom": {
            "type": "button"
          },
          "displayName": "Button",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "oOOUcyEOVr",
          "props": {
            "children": "Send again",
            "color": "primary",
            "data-type": "button",
            "formNoValidate": true,
            "full-width": true,
            "id": "resend",
            "mode": "primary",
            "size": "sm",
            "variant": "link"
          },
          "type": {
            "resolvedName": "Button"
          }
        },
        "thNbUTWOGY": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "fyz-aN6hyx"
          ],
          "parent": "yZNZ2ZVVu_",
          "props": {
            "align": "start",
            "background": "#ffffff00",
            "data-editor-type": "container",
            "direction": "row",
            "id": "thNbUTWOGY",
            "justify": "center",
            "paddingX": "4",
            "paddingY": "3",
            "spaceBetween": "1",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        },
        "yZNZ2ZVVu_": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "oneTimeCodeId",
            "thNbUTWOGY",
            "oOOUcyEOVr"
          ],
          "parent": "ROOT",
          "props": {
            "align": "center",
            "background": "",
            "data-editor-type": "container",
            "direction": "column",
            "id": "yZNZ2ZVVu_",
            "justify": "start",
            "paddingX": "4",
            "paddingY": "4",
            "spaceBetween": "1.5",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        }
      },
      "interactions": [
        {
          "id": "pnOqEGpL1b",
          "label": "Choose another authentication method"
        },
        {
          "id": "resend",
          "label": "Send again"
        },
        {
          "id": "oneTimeCodeId",
          "label": "Verify OTP code"
        }
      ],
      "screenId": "SC39wO2YjeddDmQDKeHBgk94znkhg"
    },
    {
      "contents": {
        "1sMmkeVxVT": {
          "custom": {},
          "displayName": "Error Message",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "ROOT",
          "props": {
            "align": "center",
            "data-type": "error-message",
            "full-width": false,
            "id": "1sMmkeVxVT",
            "italic": false,
            "link-target-blank": true,
            "mode": "error",
            "text-align": "center",
            "variant": "body1"
          },
          "type": {
            "resolvedName": "ErrorMessage"
          }
        },
        "ROOT": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "zkpE7FMZn8",
            "t6-aP7tsPA",
            "1sMmkeVxVT"
          ],
          "props": {
            "align": "center",
            "background": "",
            "data-editor-type": "container",
            "direction": "column",
            "id": "ROOT",
            "justify": "center",
            "paddingX": "4",
            "paddingY": "8",
            "space-between": "md",
            "spaceBetween": "4",
            "st-items-grow": 0,
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        },
        "t6-aP7tsPA": {
          "custom": {
            "type": "button"
          },
          "displayName": "Button",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "ROOT",
          "props": {
            "children": "Click Me",
            "color": "primary",
            "data-type": "button",
            "formNoValidate": false,
            "full-width": false,
            "id": "t6-aP7tsPA",
            "size": "md",
            "tooltipText": "Tooltip text",
            "variant": "contained"
          },
          "type": {
            "resolvedName": "Button"
          }
        },
        "zkpE7FMZn8": {
          "custom": {
            "type": "input"
          },
          "displayName": "Email Input",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "ROOT",
          "props": {
            "bordered": true,
            "copy-to-clipboard": false,
            "data-errormessage-pattern-mismatch": "Must be a valid email",
            "data-errormessage-value-missing": "Please fill out this field.",
            "external-input": false,
            "full-width": true,
            "id": "zkpE7FMZn8",
            "label": "Email",
            "label-type": "static",
            "max": 100,
            "name": "email",
            "pattern": "^[\\w\\.\\%\\+\\-']+@[\\w\\.\\-]+\\.[A-Za-z]{2,}$",
            "placeholder": "Email",
            "required": false,
            "size": "md",
            "type": "email"
          },
          "type": {
            "resolvedName": "EmailInput"
          }
        }
      },
      "interactions": [
        {
          "id": "t6-aP7tsPA",
          "label": "Click Me",
          "type": "button"
        }
      ],
      "screenId": "SC39wO2aQzjUkncpyrOhQMNHQPCv5"
    },
    {
      "contents": {
        "ROOT": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "auED4dEJkJ",
            "eBGiu9cYSb",
            "yZNZ2ZVVu_"
          ],
          "props": {
            "align": "center",
            "background": "",
            "data-editor-type": "container",
            "direction": "column",
            "id": "ROOT",
            "justify": "center",
            "paddingX": "4",
            "paddingY": "4",
            "spaceBetween": "5",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        },
        "auED4dEJkJ": {
          "custom": {},
          "displayName": "Text",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "ROOT",
          "props": {
            "children": "We've sent a message containing a 6-digit code to {{sentTo.maskedEmail}}",
            "full-width": false,
            "id": "auED4dEJkJ",
            "italic": false,
            "mode": "primary",
            "text-align": "center",
            "variant": "subtitle1"
          },
          "type": {
            "resolvedName": "Text"
          }
        },
        "eBGiu9cYSb": {
          "custom": {},
          "displayName": "Text",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "ROOT",
          "props": {
            "children": "Enter Code",
            "full-width": false,
            "id": "eBGiu9cYSb",
            "italic": false,
            "mode": "primary",
            "text-align": "center",
            "variant": "subtitle2"
          },
          "type": {
            "resolvedName": "Text"
          }
        },
        "fyz-aN6hyx": {
          "custom": {},
          "displayName": "Error Message",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "thNbUTWOGY",
          "props": {
            "color": "error",
            "data-type": "error-message",
            "full-width": false,
            "hide-when-empty": true,
            "id": "fyz-aN6hyx",
            "italic": false,
            "mode": "error",
            "text-align": "center",
            "variant": "body1"
          },
          "type": {
            "resolvedName": "ErrorMessage"
          }
        },
        "oOOUcyEOVr": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "resend",
            "pnOqEGpL1b"
          ],
          "parent": "yZNZ2ZVVu_",
          "props": {
            "align": "start",
            "background": "#ffffff00",
            "data-editor-type": "container",
            "direction": "row",
            "id": "oOOUcyEOVr",
            "justify": "center",
            "paddingX": "5",
            "paddingY": "0",
            "spaceBetween": "0",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        },
        "oneTimeCodeId": {
          "custom": {
            "type": "oneTimeCode"
          },
          "displayName": "One Time Code",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "yZNZ2ZVVu_",
          "props": {
            "bordered": true,
            "data-auto-submit": true,
            "data-errormessage-pattern-mismatch": "Must be a 6 digit number",
            "digits": 6,
            "full-width": false,
            "id": "oneTimeCodeId",
            "label": "",
            "name": "code",
            "required": true,
            "size": "lg",
            "type": "tel"
          },
          "type": {
            "resolvedName": "Code"
          }
        },
        "pnOqEGpL1b": {
          "custom": {
            "type": "button"
          },
          "displayName": "Button",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "oOOUcyEOVr",
          "props": {
            "children": "Choose another authentication method",
            "color": "primary",
            "data-type": "button",
            "formNoValidate": true,
            "full-width": true,
            "id": "pnOqEGpL1b",
            "mode": "primary",
            "size": "sm",
            "variant": "link"
          },
          "type": {
            "resolvedName": "Button"
          }
        },
        "resend": {
          "custom": {
            "type": "button"
          },
          "displayName": "Button",
          "hidden": false,
          "isCanvas": false,
          "linkedNodes": {},
          "nodes": [],
          "parent": "oOOUcyEOVr",
          "props": {
            "children": "Send again",
            "color": "primary",
            "data-type": "button",
            "formNoValidate": true,
            "full-width": true,
            "id": "resend",
            "mode": "primary",
            "size": "sm",
            "variant": "link"
          },
          "type": {
            "resolvedName": "Button"
          }
        },
        "thNbUTWOGY": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "fyz-aN6hyx"
          ],
          "parent": "yZNZ2ZVVu_",
          "props": {
            "align": "start",
            "background": "#ffffff00",
            "data-editor-type": "container",
            "direction": "row",
            "id": "thNbUTWOGY",
            "justify": "center",
            "paddingX": "4",
            "paddingY": "3",
            "spaceBetween": "1",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        },
        "yZNZ2ZVVu_": {
          "custom": {},
          "displayName": "Container",
          "hidden": false,
          "isCanvas": true,
          "linkedNodes": {},
          "nodes": [
            "oneTimeCodeId",
            "thNbUTWOGY",
            "oOOUcyEOVr"
          ],
          "parent": "ROOT",
          "props": {
            "align": "center",
            "background": "",
            "data-editor-type": "container",
            "direction": "column",
            "id": "yZNZ2ZVVu_",
            "justify": "start",
            "paddingX": "4",
            "paddingY": "4",
            "spaceBetween": "1.5",
            "width": "100%"
          },
          "type": {
            "resolvedName": "Container"
          }
        }
      },
      "interactions": [
        {
          "id": "pnOqEGpL1b",
          "label": "Choose another authentication method"
        },
        {
          "id": "resend",
          "label": "Send again"
        },
        {
          "id": "oneTimeCodeId",
          "label": "Verify OTP code"
        }
      ],
      "screenId": "SC39wO2aV9lY85dSQD9AQBv5xVHwZ"
    }
  ]
}