|
| 1 | +# UI Flow Overview |
| 2 | + |
| 3 | +## Existing Flow with Notes |
| 4 | + |
| 5 | +```mermaid |
| 6 | +flowchart TD |
| 7 | + Start[User Clicks Login/Signup] --Open Popup--> |
| 8 | + Wallet[User Selects/Installs Wallet]--> |
| 9 | + RequestAddresses(Request Addresses from Wallet)--> |
| 10 | + CheckMsa{"`Check Frequency |
| 11 | + for existing |
| 12 | + MSAs & Handles`"} |
| 13 | + CheckMsa--Existing MSAs Found-->Existing[Show List of MSAs] |
| 14 | +
|
| 15 | + Existing--Option: Create Account-->ACF(Account Creation Flow) |
| 16 | + Existing--Option: Select Existing MSA--> |
| 17 | + DelegationCheck{"`Check Frequency |
| 18 | + for existing Delegation`"} |
| 19 | + DelegationCheck--Has Delegation-->SignIn |
| 20 | + SignIn--Wallet: Sign SIWS Payload-->ReturnSiws([Return SIWS Payload])-->Close |
| 21 | +
|
| 22 | + DelegationCheck--Needs Delegation--> |
| 23 | + DelegationOnly[Authorize New Provider]--Wallet: Sign Delegation--> |
| 24 | + ReturnDelegationOnly([Return Delegation Only Payload])-->Close |
| 25 | +
|
| 26 | + DelegationCheck-.->noteDC>"`Note: Should also offer |
| 27 | + for handle creation |
| 28 | + if no handle found`"] |
| 29 | +
|
| 30 | +
|
| 31 | + CheckMsa--No MSAs--> |
| 32 | + ACF--> |
| 33 | + KeyAndHandle[Select Key and Handle]--Next--> |
| 34 | + KeyAndHandleValidate[Sign Handle]--Wallet: Sign Handle--> |
| 35 | + DelegateValidate[Sign Permissions]--Wallet: Sign Delegation Permissions--> |
| 36 | + ReturnSignup([Return Signup Payload])-->Close |
| 37 | +
|
| 38 | + KeyAndHandle-.->noteKH>"`Note: Should also offer |
| 39 | + to skip handle creation`"] |
| 40 | +
|
| 41 | + Close(("`Close Popup |
| 42 | + & Return Payload`")) |
| 43 | + Wallet-.->noteWallet>"`Note: Each Wallet can |
| 44 | + have different flows`"] |
| 45 | +``` |
| 46 | + |
| 47 | +## Web Wallet Integration Option 1: Use SIWF UI |
| 48 | + |
| 49 | +Open Question: How can we make sure the auth token isn't hijacked? |
| 50 | + |
| 51 | +```mermaid |
| 52 | +flowchart TD |
| 53 | + Start[User Clicks Login/Signup] --Open Popup--> |
| 54 | + Wallet[User Selects Web Wallet]--> |
| 55 | + WW[Multistep: Web Wallet Login Flow]--> |
| 56 | + ReturnSIWF["`Return to SIWF UI |
| 57 | + with Authorization Token |
| 58 | + for single Address`"]--> |
| 59 | + RequestAddresses[[Background Request Address with Token]]--> |
| 60 | + CheckMsa{"`Check Frequency |
| 61 | + for existing |
| 62 | + MSA & Handle`"} |
| 63 | + CheckMsa--Existing MSA Found-->Existing[Show MSA & Handle] |
| 64 | +
|
| 65 | + Existing--Option: Create Account-->ACF(Account Creation Flow) |
| 66 | + Existing--Option: Select Existing MSA--> |
| 67 | + DelegationCheck{"`Check Frequency |
| 68 | + for existing Delegation`"} |
| 69 | + DelegationCheck--Has Delegation--> |
| 70 | + SignInValidate[[Background Request with Token: Sign SignIn]]--> |
| 71 | + ReturnSignIn([Return Signin Payload])-->Close |
| 72 | +
|
| 73 | + DelegationCheck--Needs Delegation--> |
| 74 | + DelegationOnly[[Background Request with Token: Sign Delegation]]--> |
| 75 | + ReturnDelegationOnly([Return Delegation Only Payload])-->Close |
| 76 | +
|
| 77 | + CheckMsa--No MSAs--> |
| 78 | + ACF--> |
| 79 | + KeyAndHandle[Select Handle]--Next--> |
| 80 | + KeyAndHandleValidate[[Background Request with Token: Sign Handle]]--> |
| 81 | + DelegateValidate[Verify Permissions]--Next--> |
| 82 | + DelegationValidate[[Background Request with Token: Sign Delegation]]--> |
| 83 | + ReturnSignup([Return Signup Payload])-->Close |
| 84 | +
|
| 85 | + Close(("`Close Popup |
| 86 | + & Return Payload`")) |
| 87 | +``` |
| 88 | + |
| 89 | +## Web Wallet Integration Option 2: Custom UI |
| 90 | + |
| 91 | +```mermaid |
| 92 | +flowchart TD |
| 93 | + Start2["`User Clicks |
| 94 | + Web Wallet Specific |
| 95 | + Login/Signup Button`"]-->RedirectWW |
| 96 | + Start[User Clicks SIWF Login/Signup] --Open Popup--> |
| 97 | + Wallet[User Selects Web Wallet]--> |
| 98 | + RedirectWW[Redirect to Web Wallet]--> |
| 99 | +
|
| 100 | + WWLogin[Login/Signup Flow for Web Wallet]--> |
| 101 | + WWLoginEmail[Web Wallet Authentication/Registration]--> |
| 102 | +
|
| 103 | + CheckMsa{"`Find Existing Account(s)`"} |
| 104 | + CheckMsa--Existing Account(s) Found-->Existing[Select Account] |
| 105 | +
|
| 106 | + Existing--Option: Create Account-->ACF(Account Creation Flow) |
| 107 | + Existing--Option: Select Existing Account--> |
| 108 | + DelegationCheck{"`Check Frequency |
| 109 | + for existing Delegation`"} |
| 110 | + DelegationCheck--Has Delegation--> |
| 111 | + SignInVerify[Verify User Signin Request]--> |
| 112 | + BackgroundSignSIWS[[Background: Sign SIWS]]--Redirect-->ReturnSIWF |
| 113 | +
|
| 114 | + DelegationCheck--Needs Delegation--> |
| 115 | + DelegationVerify[Verify User Delegation Request]--> |
| 116 | + DelegationOnly[[Background: Sign Delegation]]--> |
| 117 | + ReturnDelegationOnly([Return Delegation Only Payload])--Redirect-->ReturnSIWF |
| 118 | +
|
| 119 | + CheckMsa--No Account--> |
| 120 | + ACF--> |
| 121 | + KeyAndHandle[User Selects Handle]--Next--> |
| 122 | + PermissionsVerify[User Verifies Permissions]--Next--> |
| 123 | + DelegationValidate[[Background: Sign Delegation & Sign Handle]]--Redirect--> |
| 124 | +
|
| 125 | + ReturnSIWF["Return to SIWF UI with Payload"]--> |
| 126 | + ReturnSignup([Return SIWF Structured Payload])--> |
| 127 | + Close(("`Close Popup |
| 128 | + & Return Payload`")) |
| 129 | +``` |
0 commit comments