My App
Flow

Route gate current-context

Flow route gate ở frontend để load current workspace context.

Mục tiêu

Load current context trước khi vào các app surface theo branch-scoped token.

User journey

Sau auth, frontend request current context và quyết định user được vào app, tiếp tục setup, hoặc xử lý locked state.

API sequence

  1. Gửi branch-scoped token tới GET /api/workspaces/current-context.
  2. Gateway validate token và route tới Entitlement.
  3. Frontend nhận context hoặc error state.

Thay đổi state FE

  • Set active workspace/member/branch context.
  • Set setup state.
  • Set entitlement/lock indicator.

Rule redirect

  • Context complete redirect tới app shell.
  • Setup chưa complete redirect tới setup flow.
  • Response unauthorized redirect tới login.

Xử lý lỗi

Xử lý branch token bị thiếu, không hợp lệ hoặc hết hạn. Giữ request/correlation IDs.

Use case liên quan

On this page