-
Notifications
You must be signed in to change notification settings - Fork 0
account registration
Roberto Caiola edited this page May 24, 2023
·
1 revision
sequenceDiagram
participant web as Web Browser
participant blog as Ad Service
participant account as Account Service
participant mail as Mail Service
participant sql as Database
participant file as Storage
Note over web,file: The user starts account registration
web->>+account: Start registration
Note right of web: POST /auth/registration<br/>{"username","email"}
account->>sql: Query username and email
sql->>account: Respond with query result
alt Email or username exists
account->>web: Invalid details (need to recover login details)
Note right of web: RESPONSE: {"success":false,<br>"errors":{["username":"username exists",<br>"email":"email exists"}}
else Email and username not found, can proceed with registration
account->>web: Successfully registers
Note right of web: RESPONSE: {"account":{"account_id":1},<br>"stores":{"store_id":1},<br>"user":{"user_id":1}}}
account->>sql: Create account, store, user to status NEW
end
Note over web,file: After registration, notification is sent for email verification
account->>sql: Queue email
account->>mail: Dispatch email
Note over web,file: Email verification, user click on url to activate account
web->>account: Click url with token
account->>sql: Update account, store, user status to ACTIVE
Sidebar example