跳转到主要内容

Saving confirmation

sequenceDiagram
    participant usr as New User
    participant front as Front End
    participant back as Back End

    usr ->> front: Login
    front ->> back: Send Login Data
    back ->> back: Create ctx
    back ->> back: Check Credentials and Authorize the login
    back ->> back: Check for existence of ServiceMessage by type
    alt service message of type modal exists
        back ->> back: User.MustShowServiceMessages(smType, smTimestamp)
        alt service message needs to be shown
            back ->> back: Set ctx.Data["ModalServiceMessageTitle"]
            back ->> back: Set ctx.Data["RenderedContent"]
        end
    end
    back ->> front: Redirect to dashboard
    front ->> front: Check if ModalServiceMessageTitle is set
    alt modal service message is set
        front ->> usr: Serve html rendered Service Message Modal
        usr ->> front: Read and click "Confirm" button
        front ->> back: POST confirmation to {{AppSubUrl}}/user/confirm?sm_type={{.Type}}
        back ->> back: User.SetConfirm(sm.Type)
        back ->> back: Unset ctx.Data["ModalServiceMessageTitle"]
    end
    front ->> usr: Redirect to initially visited page